Line data Source code
1 : /* Generated by Cython 3.0.11 */
2 :
3 : #ifndef PY_SSIZE_T_CLEAN
4 : #define PY_SSIZE_T_CLEAN
5 : #endif /* PY_SSIZE_T_CLEAN */
6 : #if defined(CYTHON_LIMITED_API) && 0
7 : #ifndef Py_LIMITED_API
8 : #if CYTHON_LIMITED_API+0 > 0x03030000
9 : #define Py_LIMITED_API CYTHON_LIMITED_API
10 : #else
11 : #define Py_LIMITED_API 0x03030000
12 : #endif
13 : #endif
14 : #endif
15 :
16 : #include "Python.h"
17 : #ifndef Py_PYTHON_H
18 : #error Python headers needed to compile C extensions, please install development version of Python.
19 : #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
20 : #error Cython requires Python 2.7+ or Python 3.3+.
21 : #else
22 : #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
23 : #define __PYX_EXTRA_ABI_MODULE_NAME "limited"
24 : #else
25 : #define __PYX_EXTRA_ABI_MODULE_NAME ""
26 : #endif
27 : #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
28 : #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
29 : #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
30 : #define CYTHON_HEX_VERSION 0x03000BF0
31 : #define CYTHON_FUTURE_DIVISION 1
32 : #include <stddef.h>
33 : #ifndef offsetof
34 : #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
35 : #endif
36 : #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
37 : #ifndef __stdcall
38 : #define __stdcall
39 : #endif
40 : #ifndef __cdecl
41 : #define __cdecl
42 : #endif
43 : #ifndef __fastcall
44 : #define __fastcall
45 : #endif
46 : #endif
47 : #ifndef DL_IMPORT
48 : #define DL_IMPORT(t) t
49 : #endif
50 : #ifndef DL_EXPORT
51 : #define DL_EXPORT(t) t
52 : #endif
53 : #define __PYX_COMMA ,
54 : #ifndef HAVE_LONG_LONG
55 : #define HAVE_LONG_LONG
56 : #endif
57 : #ifndef PY_LONG_LONG
58 : #define PY_LONG_LONG LONG_LONG
59 : #endif
60 : #ifndef Py_HUGE_VAL
61 : #define Py_HUGE_VAL HUGE_VAL
62 : #endif
63 : #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
64 : #if defined(GRAALVM_PYTHON)
65 : /* For very preliminary testing purposes. Most variables are set the same as PyPy.
66 : The existence of this section does not imply that anything works or is even tested */
67 : #define CYTHON_COMPILING_IN_PYPY 0
68 : #define CYTHON_COMPILING_IN_CPYTHON 0
69 : #define CYTHON_COMPILING_IN_LIMITED_API 0
70 : #define CYTHON_COMPILING_IN_GRAAL 1
71 : #define CYTHON_COMPILING_IN_NOGIL 0
72 : #undef CYTHON_USE_TYPE_SLOTS
73 : #define CYTHON_USE_TYPE_SLOTS 0
74 : #undef CYTHON_USE_TYPE_SPECS
75 : #define CYTHON_USE_TYPE_SPECS 0
76 : #undef CYTHON_USE_PYTYPE_LOOKUP
77 : #define CYTHON_USE_PYTYPE_LOOKUP 0
78 : #if PY_VERSION_HEX < 0x03050000
79 : #undef CYTHON_USE_ASYNC_SLOTS
80 : #define CYTHON_USE_ASYNC_SLOTS 0
81 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
82 : #define CYTHON_USE_ASYNC_SLOTS 1
83 : #endif
84 : #undef CYTHON_USE_PYLIST_INTERNALS
85 : #define CYTHON_USE_PYLIST_INTERNALS 0
86 : #undef CYTHON_USE_UNICODE_INTERNALS
87 : #define CYTHON_USE_UNICODE_INTERNALS 0
88 : #undef CYTHON_USE_UNICODE_WRITER
89 : #define CYTHON_USE_UNICODE_WRITER 0
90 : #undef CYTHON_USE_PYLONG_INTERNALS
91 : #define CYTHON_USE_PYLONG_INTERNALS 0
92 : #undef CYTHON_AVOID_BORROWED_REFS
93 : #define CYTHON_AVOID_BORROWED_REFS 1
94 : #undef CYTHON_ASSUME_SAFE_MACROS
95 : #define CYTHON_ASSUME_SAFE_MACROS 0
96 : #undef CYTHON_UNPACK_METHODS
97 : #define CYTHON_UNPACK_METHODS 0
98 : #undef CYTHON_FAST_THREAD_STATE
99 : #define CYTHON_FAST_THREAD_STATE 0
100 : #undef CYTHON_FAST_GIL
101 : #define CYTHON_FAST_GIL 0
102 : #undef CYTHON_METH_FASTCALL
103 : #define CYTHON_METH_FASTCALL 0
104 : #undef CYTHON_FAST_PYCALL
105 : #define CYTHON_FAST_PYCALL 0
106 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
107 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
108 : #endif
109 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
110 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
111 : #undef CYTHON_USE_MODULE_STATE
112 : #define CYTHON_USE_MODULE_STATE 0
113 : #undef CYTHON_USE_TP_FINALIZE
114 : #define CYTHON_USE_TP_FINALIZE 0
115 : #undef CYTHON_USE_DICT_VERSIONS
116 : #define CYTHON_USE_DICT_VERSIONS 0
117 : #undef CYTHON_USE_EXC_INFO_STACK
118 : #define CYTHON_USE_EXC_INFO_STACK 0
119 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
120 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
121 : #endif
122 : #undef CYTHON_USE_FREELISTS
123 : #define CYTHON_USE_FREELISTS 0
124 : #elif defined(PYPY_VERSION)
125 : #define CYTHON_COMPILING_IN_PYPY 1
126 : #define CYTHON_COMPILING_IN_CPYTHON 0
127 : #define CYTHON_COMPILING_IN_LIMITED_API 0
128 : #define CYTHON_COMPILING_IN_GRAAL 0
129 : #define CYTHON_COMPILING_IN_NOGIL 0
130 : #undef CYTHON_USE_TYPE_SLOTS
131 : #define CYTHON_USE_TYPE_SLOTS 0
132 : #ifndef CYTHON_USE_TYPE_SPECS
133 : #define CYTHON_USE_TYPE_SPECS 0
134 : #endif
135 : #undef CYTHON_USE_PYTYPE_LOOKUP
136 : #define CYTHON_USE_PYTYPE_LOOKUP 0
137 : #if PY_VERSION_HEX < 0x03050000
138 : #undef CYTHON_USE_ASYNC_SLOTS
139 : #define CYTHON_USE_ASYNC_SLOTS 0
140 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
141 : #define CYTHON_USE_ASYNC_SLOTS 1
142 : #endif
143 : #undef CYTHON_USE_PYLIST_INTERNALS
144 : #define CYTHON_USE_PYLIST_INTERNALS 0
145 : #undef CYTHON_USE_UNICODE_INTERNALS
146 : #define CYTHON_USE_UNICODE_INTERNALS 0
147 : #undef CYTHON_USE_UNICODE_WRITER
148 : #define CYTHON_USE_UNICODE_WRITER 0
149 : #undef CYTHON_USE_PYLONG_INTERNALS
150 : #define CYTHON_USE_PYLONG_INTERNALS 0
151 : #undef CYTHON_AVOID_BORROWED_REFS
152 : #define CYTHON_AVOID_BORROWED_REFS 1
153 : #undef CYTHON_ASSUME_SAFE_MACROS
154 : #define CYTHON_ASSUME_SAFE_MACROS 0
155 : #undef CYTHON_UNPACK_METHODS
156 : #define CYTHON_UNPACK_METHODS 0
157 : #undef CYTHON_FAST_THREAD_STATE
158 : #define CYTHON_FAST_THREAD_STATE 0
159 : #undef CYTHON_FAST_GIL
160 : #define CYTHON_FAST_GIL 0
161 : #undef CYTHON_METH_FASTCALL
162 : #define CYTHON_METH_FASTCALL 0
163 : #undef CYTHON_FAST_PYCALL
164 : #define CYTHON_FAST_PYCALL 0
165 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
166 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
167 : #endif
168 : #if PY_VERSION_HEX < 0x03090000
169 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
170 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
171 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
172 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
173 : #endif
174 : #undef CYTHON_USE_MODULE_STATE
175 : #define CYTHON_USE_MODULE_STATE 0
176 : #undef CYTHON_USE_TP_FINALIZE
177 : #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
178 : #undef CYTHON_USE_DICT_VERSIONS
179 : #define CYTHON_USE_DICT_VERSIONS 0
180 : #undef CYTHON_USE_EXC_INFO_STACK
181 : #define CYTHON_USE_EXC_INFO_STACK 0
182 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
183 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
184 : #endif
185 : #undef CYTHON_USE_FREELISTS
186 : #define CYTHON_USE_FREELISTS 0
187 : #elif defined(CYTHON_LIMITED_API)
188 : #ifdef Py_LIMITED_API
189 : #undef __PYX_LIMITED_VERSION_HEX
190 : #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
191 : #endif
192 : #define CYTHON_COMPILING_IN_PYPY 0
193 : #define CYTHON_COMPILING_IN_CPYTHON 0
194 : #define CYTHON_COMPILING_IN_LIMITED_API 1
195 : #define CYTHON_COMPILING_IN_GRAAL 0
196 : #define CYTHON_COMPILING_IN_NOGIL 0
197 : #undef CYTHON_CLINE_IN_TRACEBACK
198 : #define CYTHON_CLINE_IN_TRACEBACK 0
199 : #undef CYTHON_USE_TYPE_SLOTS
200 : #define CYTHON_USE_TYPE_SLOTS 0
201 : #undef CYTHON_USE_TYPE_SPECS
202 : #define CYTHON_USE_TYPE_SPECS 1
203 : #undef CYTHON_USE_PYTYPE_LOOKUP
204 : #define CYTHON_USE_PYTYPE_LOOKUP 0
205 : #undef CYTHON_USE_ASYNC_SLOTS
206 : #define CYTHON_USE_ASYNC_SLOTS 0
207 : #undef CYTHON_USE_PYLIST_INTERNALS
208 : #define CYTHON_USE_PYLIST_INTERNALS 0
209 : #undef CYTHON_USE_UNICODE_INTERNALS
210 : #define CYTHON_USE_UNICODE_INTERNALS 0
211 : #ifndef CYTHON_USE_UNICODE_WRITER
212 : #define CYTHON_USE_UNICODE_WRITER 0
213 : #endif
214 : #undef CYTHON_USE_PYLONG_INTERNALS
215 : #define CYTHON_USE_PYLONG_INTERNALS 0
216 : #ifndef CYTHON_AVOID_BORROWED_REFS
217 : #define CYTHON_AVOID_BORROWED_REFS 0
218 : #endif
219 : #undef CYTHON_ASSUME_SAFE_MACROS
220 : #define CYTHON_ASSUME_SAFE_MACROS 0
221 : #undef CYTHON_UNPACK_METHODS
222 : #define CYTHON_UNPACK_METHODS 0
223 : #undef CYTHON_FAST_THREAD_STATE
224 : #define CYTHON_FAST_THREAD_STATE 0
225 : #undef CYTHON_FAST_GIL
226 : #define CYTHON_FAST_GIL 0
227 : #undef CYTHON_METH_FASTCALL
228 : #define CYTHON_METH_FASTCALL 0
229 : #undef CYTHON_FAST_PYCALL
230 : #define CYTHON_FAST_PYCALL 0
231 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
232 : #define CYTHON_PEP487_INIT_SUBCLASS 1
233 : #endif
234 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
235 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
236 : #undef CYTHON_USE_MODULE_STATE
237 : #define CYTHON_USE_MODULE_STATE 1
238 : #ifndef CYTHON_USE_TP_FINALIZE
239 : #define CYTHON_USE_TP_FINALIZE 0
240 : #endif
241 : #undef CYTHON_USE_DICT_VERSIONS
242 : #define CYTHON_USE_DICT_VERSIONS 0
243 : #undef CYTHON_USE_EXC_INFO_STACK
244 : #define CYTHON_USE_EXC_INFO_STACK 0
245 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
246 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
247 : #endif
248 : #undef CYTHON_USE_FREELISTS
249 : #define CYTHON_USE_FREELISTS 0
250 : #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
251 : #define CYTHON_COMPILING_IN_PYPY 0
252 : #define CYTHON_COMPILING_IN_CPYTHON 0
253 : #define CYTHON_COMPILING_IN_LIMITED_API 0
254 : #define CYTHON_COMPILING_IN_GRAAL 0
255 : #define CYTHON_COMPILING_IN_NOGIL 1
256 : #ifndef CYTHON_USE_TYPE_SLOTS
257 : #define CYTHON_USE_TYPE_SLOTS 1
258 : #endif
259 : #ifndef CYTHON_USE_TYPE_SPECS
260 : #define CYTHON_USE_TYPE_SPECS 0
261 : #endif
262 : #undef CYTHON_USE_PYTYPE_LOOKUP
263 : #define CYTHON_USE_PYTYPE_LOOKUP 0
264 : #ifndef CYTHON_USE_ASYNC_SLOTS
265 : #define CYTHON_USE_ASYNC_SLOTS 1
266 : #endif
267 : #ifndef CYTHON_USE_PYLONG_INTERNALS
268 : #define CYTHON_USE_PYLONG_INTERNALS 0
269 : #endif
270 : #undef CYTHON_USE_PYLIST_INTERNALS
271 : #define CYTHON_USE_PYLIST_INTERNALS 0
272 : #ifndef CYTHON_USE_UNICODE_INTERNALS
273 : #define CYTHON_USE_UNICODE_INTERNALS 1
274 : #endif
275 : #undef CYTHON_USE_UNICODE_WRITER
276 : #define CYTHON_USE_UNICODE_WRITER 0
277 : #ifndef CYTHON_AVOID_BORROWED_REFS
278 : #define CYTHON_AVOID_BORROWED_REFS 0
279 : #endif
280 : #ifndef CYTHON_ASSUME_SAFE_MACROS
281 : #define CYTHON_ASSUME_SAFE_MACROS 1
282 : #endif
283 : #ifndef CYTHON_UNPACK_METHODS
284 : #define CYTHON_UNPACK_METHODS 1
285 : #endif
286 : #undef CYTHON_FAST_THREAD_STATE
287 : #define CYTHON_FAST_THREAD_STATE 0
288 : #undef CYTHON_FAST_GIL
289 : #define CYTHON_FAST_GIL 0
290 : #ifndef CYTHON_METH_FASTCALL
291 : #define CYTHON_METH_FASTCALL 1
292 : #endif
293 : #undef CYTHON_FAST_PYCALL
294 : #define CYTHON_FAST_PYCALL 0
295 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
296 : #define CYTHON_PEP487_INIT_SUBCLASS 1
297 : #endif
298 : #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
299 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
300 : #endif
301 : #ifndef CYTHON_USE_MODULE_STATE
302 : #define CYTHON_USE_MODULE_STATE 0
303 : #endif
304 : #ifndef CYTHON_USE_TP_FINALIZE
305 : #define CYTHON_USE_TP_FINALIZE 1
306 : #endif
307 : #undef CYTHON_USE_DICT_VERSIONS
308 : #define CYTHON_USE_DICT_VERSIONS 0
309 : #undef CYTHON_USE_EXC_INFO_STACK
310 : #define CYTHON_USE_EXC_INFO_STACK 0
311 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
312 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
313 : #endif
314 : #ifndef CYTHON_USE_FREELISTS
315 : #define CYTHON_USE_FREELISTS 0
316 : #endif
317 : #else
318 : #define CYTHON_COMPILING_IN_PYPY 0
319 : #define CYTHON_COMPILING_IN_CPYTHON 1
320 : #define CYTHON_COMPILING_IN_LIMITED_API 0
321 : #define CYTHON_COMPILING_IN_GRAAL 0
322 : #define CYTHON_COMPILING_IN_NOGIL 0
323 : #ifndef CYTHON_USE_TYPE_SLOTS
324 : #define CYTHON_USE_TYPE_SLOTS 1
325 : #endif
326 : #ifndef CYTHON_USE_TYPE_SPECS
327 : #define CYTHON_USE_TYPE_SPECS 0
328 : #endif
329 : #ifndef CYTHON_USE_PYTYPE_LOOKUP
330 : #define CYTHON_USE_PYTYPE_LOOKUP 1
331 : #endif
332 : #if PY_MAJOR_VERSION < 3
333 : #undef CYTHON_USE_ASYNC_SLOTS
334 : #define CYTHON_USE_ASYNC_SLOTS 0
335 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
336 : #define CYTHON_USE_ASYNC_SLOTS 1
337 : #endif
338 : #ifndef CYTHON_USE_PYLONG_INTERNALS
339 : #define CYTHON_USE_PYLONG_INTERNALS 1
340 : #endif
341 : #ifndef CYTHON_USE_PYLIST_INTERNALS
342 : #define CYTHON_USE_PYLIST_INTERNALS 1
343 : #endif
344 : #ifndef CYTHON_USE_UNICODE_INTERNALS
345 : #define CYTHON_USE_UNICODE_INTERNALS 1
346 : #endif
347 : #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
348 : #undef CYTHON_USE_UNICODE_WRITER
349 : #define CYTHON_USE_UNICODE_WRITER 0
350 : #elif !defined(CYTHON_USE_UNICODE_WRITER)
351 : #define CYTHON_USE_UNICODE_WRITER 1
352 : #endif
353 : #ifndef CYTHON_AVOID_BORROWED_REFS
354 : #define CYTHON_AVOID_BORROWED_REFS 0
355 : #endif
356 : #ifndef CYTHON_ASSUME_SAFE_MACROS
357 : #define CYTHON_ASSUME_SAFE_MACROS 1
358 : #endif
359 : #ifndef CYTHON_UNPACK_METHODS
360 : #define CYTHON_UNPACK_METHODS 1
361 : #endif
362 : #ifndef CYTHON_FAST_THREAD_STATE
363 : #define CYTHON_FAST_THREAD_STATE 1
364 : #endif
365 : #ifndef CYTHON_FAST_GIL
366 : #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
367 : #endif
368 : #ifndef CYTHON_METH_FASTCALL
369 : #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
370 : #endif
371 : #ifndef CYTHON_FAST_PYCALL
372 : #define CYTHON_FAST_PYCALL 1
373 : #endif
374 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
375 : #define CYTHON_PEP487_INIT_SUBCLASS 1
376 : #endif
377 : #if PY_VERSION_HEX < 0x03050000
378 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
379 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
380 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
381 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
382 : #endif
383 : #ifndef CYTHON_USE_MODULE_STATE
384 : #define CYTHON_USE_MODULE_STATE 0
385 : #endif
386 : #if PY_VERSION_HEX < 0x030400a1
387 : #undef CYTHON_USE_TP_FINALIZE
388 : #define CYTHON_USE_TP_FINALIZE 0
389 : #elif !defined(CYTHON_USE_TP_FINALIZE)
390 : #define CYTHON_USE_TP_FINALIZE 1
391 : #endif
392 : #if PY_VERSION_HEX < 0x030600B1
393 : #undef CYTHON_USE_DICT_VERSIONS
394 : #define CYTHON_USE_DICT_VERSIONS 0
395 : #elif !defined(CYTHON_USE_DICT_VERSIONS)
396 : #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
397 : #endif
398 : #if PY_VERSION_HEX < 0x030700A3
399 : #undef CYTHON_USE_EXC_INFO_STACK
400 : #define CYTHON_USE_EXC_INFO_STACK 0
401 : #elif !defined(CYTHON_USE_EXC_INFO_STACK)
402 : #define CYTHON_USE_EXC_INFO_STACK 1
403 : #endif
404 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
405 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
406 : #endif
407 : #ifndef CYTHON_USE_FREELISTS
408 : #define CYTHON_USE_FREELISTS 1
409 : #endif
410 : #endif
411 : #if !defined(CYTHON_FAST_PYCCALL)
412 : #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
413 : #endif
414 : #if !defined(CYTHON_VECTORCALL)
415 : #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
416 : #endif
417 : #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
418 : #if CYTHON_USE_PYLONG_INTERNALS
419 : #if PY_MAJOR_VERSION < 3
420 : #include "longintrepr.h"
421 : #endif
422 : #undef SHIFT
423 : #undef BASE
424 : #undef MASK
425 : #ifdef SIZEOF_VOID_P
426 : enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
427 : #endif
428 : #endif
429 : #ifndef __has_attribute
430 : #define __has_attribute(x) 0
431 : #endif
432 : #ifndef __has_cpp_attribute
433 : #define __has_cpp_attribute(x) 0
434 : #endif
435 : #ifndef CYTHON_RESTRICT
436 : #if defined(__GNUC__)
437 : #define CYTHON_RESTRICT __restrict__
438 : #elif defined(_MSC_VER) && _MSC_VER >= 1400
439 : #define CYTHON_RESTRICT __restrict
440 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
441 : #define CYTHON_RESTRICT restrict
442 : #else
443 : #define CYTHON_RESTRICT
444 : #endif
445 : #endif
446 : #ifndef CYTHON_UNUSED
447 : #if defined(__cplusplus)
448 : /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
449 : * but leads to warnings with -pedantic, since it is a C++17 feature */
450 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
451 : #if __has_cpp_attribute(maybe_unused)
452 : #define CYTHON_UNUSED [[maybe_unused]]
453 : #endif
454 : #endif
455 : #endif
456 : #endif
457 : #ifndef CYTHON_UNUSED
458 : # if defined(__GNUC__)
459 : # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
460 : # define CYTHON_UNUSED __attribute__ ((__unused__))
461 : # else
462 : # define CYTHON_UNUSED
463 : # endif
464 : # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
465 : # define CYTHON_UNUSED __attribute__ ((__unused__))
466 : # else
467 : # define CYTHON_UNUSED
468 : # endif
469 : #endif
470 : #ifndef CYTHON_UNUSED_VAR
471 : # if defined(__cplusplus)
472 : template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
473 : # else
474 : # define CYTHON_UNUSED_VAR(x) (void)(x)
475 : # endif
476 : #endif
477 : #ifndef CYTHON_MAYBE_UNUSED_VAR
478 : #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
479 : #endif
480 : #ifndef CYTHON_NCP_UNUSED
481 : # if CYTHON_COMPILING_IN_CPYTHON
482 : # define CYTHON_NCP_UNUSED
483 : # else
484 : # define CYTHON_NCP_UNUSED CYTHON_UNUSED
485 : # endif
486 : #endif
487 : #ifndef CYTHON_USE_CPP_STD_MOVE
488 : #if defined(__cplusplus) && (\
489 : __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
490 : #define CYTHON_USE_CPP_STD_MOVE 1
491 : #else
492 : #define CYTHON_USE_CPP_STD_MOVE 0
493 : #endif
494 : #endif
495 : #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
496 : #ifdef _MSC_VER
497 : #ifndef _MSC_STDINT_H_
498 : #if _MSC_VER < 1300
499 : typedef unsigned char uint8_t;
500 : typedef unsigned short uint16_t;
501 : typedef unsigned int uint32_t;
502 : #else
503 : typedef unsigned __int8 uint8_t;
504 : typedef unsigned __int16 uint16_t;
505 : typedef unsigned __int32 uint32_t;
506 : #endif
507 : #endif
508 : #if _MSC_VER < 1300
509 : #ifdef _WIN64
510 : typedef unsigned long long __pyx_uintptr_t;
511 : #else
512 : typedef unsigned int __pyx_uintptr_t;
513 : #endif
514 : #else
515 : #ifdef _WIN64
516 : typedef unsigned __int64 __pyx_uintptr_t;
517 : #else
518 : typedef unsigned __int32 __pyx_uintptr_t;
519 : #endif
520 : #endif
521 : #else
522 : #include <stdint.h>
523 : typedef uintptr_t __pyx_uintptr_t;
524 : #endif
525 : #ifndef CYTHON_FALLTHROUGH
526 : #if defined(__cplusplus)
527 : /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
528 : * but leads to warnings with -pedantic, since it is a C++17 feature */
529 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
530 : #if __has_cpp_attribute(fallthrough)
531 : #define CYTHON_FALLTHROUGH [[fallthrough]]
532 : #endif
533 : #endif
534 : #ifndef CYTHON_FALLTHROUGH
535 : #if __has_cpp_attribute(clang::fallthrough)
536 : #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
537 : #elif __has_cpp_attribute(gnu::fallthrough)
538 : #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
539 : #endif
540 : #endif
541 : #endif
542 : #ifndef CYTHON_FALLTHROUGH
543 : #if __has_attribute(fallthrough)
544 : #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
545 : #else
546 : #define CYTHON_FALLTHROUGH
547 : #endif
548 : #endif
549 : #if defined(__clang__) && defined(__apple_build_version__)
550 : #if __apple_build_version__ < 7000000
551 : #undef CYTHON_FALLTHROUGH
552 : #define CYTHON_FALLTHROUGH
553 : #endif
554 : #endif
555 : #endif
556 : #ifdef __cplusplus
557 : template <typename T>
558 : struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
559 : #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
560 : #else
561 : #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
562 : #endif
563 : #if CYTHON_COMPILING_IN_PYPY == 1
564 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
565 : #else
566 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
567 : #endif
568 : #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
569 :
570 : #ifndef CYTHON_INLINE
571 : #if defined(__clang__)
572 : #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
573 : #elif defined(__GNUC__)
574 : #define CYTHON_INLINE __inline__
575 : #elif defined(_MSC_VER)
576 : #define CYTHON_INLINE __inline
577 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
578 : #define CYTHON_INLINE inline
579 : #else
580 : #define CYTHON_INLINE
581 : #endif
582 : #endif
583 :
584 : #define __PYX_BUILD_PY_SSIZE_T "n"
585 : #define CYTHON_FORMAT_SSIZE_T "z"
586 : #if PY_MAJOR_VERSION < 3
587 : #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
588 : #define __Pyx_DefaultClassType PyClass_Type
589 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
590 : PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
591 : #else
592 : #define __Pyx_BUILTIN_MODULE_NAME "builtins"
593 : #define __Pyx_DefaultClassType PyType_Type
594 : #if CYTHON_COMPILING_IN_LIMITED_API
595 : static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
596 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
597 : PyObject *fv, PyObject *cell, PyObject* fn,
598 : PyObject *name, int fline, PyObject *lnos) {
599 : PyObject *exception_table = NULL;
600 : PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
601 : #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
602 : PyObject *version_info;
603 : PyObject *py_minor_version = NULL;
604 : #endif
605 : long minor_version = 0;
606 : PyObject *type, *value, *traceback;
607 : PyErr_Fetch(&type, &value, &traceback);
608 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
609 : minor_version = 11;
610 : #else
611 : if (!(version_info = PySys_GetObject("version_info"))) goto end;
612 : if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
613 : minor_version = PyLong_AsLong(py_minor_version);
614 : Py_DECREF(py_minor_version);
615 : if (minor_version == -1 && PyErr_Occurred()) goto end;
616 : #endif
617 : if (!(types_module = PyImport_ImportModule("types"))) goto end;
618 : if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
619 : if (minor_version <= 7) {
620 : (void)p;
621 : result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
622 : c, n, v, fn, name, fline, lnos, fv, cell);
623 : } else if (minor_version <= 10) {
624 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
625 : c, n, v, fn, name, fline, lnos, fv, cell);
626 : } else {
627 : if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
628 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
629 : c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
630 : }
631 : end:
632 : Py_XDECREF(code_type);
633 : Py_XDECREF(exception_table);
634 : Py_XDECREF(types_module);
635 : if (type) {
636 : PyErr_Restore(type, value, traceback);
637 : }
638 : return result;
639 : }
640 : #ifndef CO_OPTIMIZED
641 : #define CO_OPTIMIZED 0x0001
642 : #endif
643 : #ifndef CO_NEWLOCALS
644 : #define CO_NEWLOCALS 0x0002
645 : #endif
646 : #ifndef CO_VARARGS
647 : #define CO_VARARGS 0x0004
648 : #endif
649 : #ifndef CO_VARKEYWORDS
650 : #define CO_VARKEYWORDS 0x0008
651 : #endif
652 : #ifndef CO_ASYNC_GENERATOR
653 : #define CO_ASYNC_GENERATOR 0x0200
654 : #endif
655 : #ifndef CO_GENERATOR
656 : #define CO_GENERATOR 0x0020
657 : #endif
658 : #ifndef CO_COROUTINE
659 : #define CO_COROUTINE 0x0080
660 : #endif
661 : #elif PY_VERSION_HEX >= 0x030B0000
662 3 : static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
663 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
664 : PyObject *fv, PyObject *cell, PyObject* fn,
665 : PyObject *name, int fline, PyObject *lnos) {
666 3 : PyCodeObject *result;
667 3 : PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
668 3 : if (!empty_bytes) return NULL;
669 3 : result =
670 : #if PY_VERSION_HEX >= 0x030C0000
671 3 : PyUnstable_Code_NewWithPosOnlyArgs
672 : #else
673 : PyCode_NewWithPosOnlyArgs
674 : #endif
675 : (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
676 3 : Py_DECREF(empty_bytes);
677 : return result;
678 : }
679 : #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
680 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
681 : PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
682 : #else
683 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
684 : PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
685 : #endif
686 : #endif
687 : #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
688 : #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
689 : #else
690 : #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
691 : #endif
692 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
693 : #define __Pyx_Py_Is(x, y) Py_Is(x, y)
694 : #else
695 : #define __Pyx_Py_Is(x, y) ((x) == (y))
696 : #endif
697 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
698 : #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
699 : #else
700 : #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
701 : #endif
702 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
703 : #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
704 : #else
705 : #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
706 : #endif
707 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
708 : #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
709 : #else
710 : #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
711 : #endif
712 : #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
713 : #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
714 : #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
715 : #else
716 : #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
717 : #endif
718 : #ifndef CO_COROUTINE
719 : #define CO_COROUTINE 0x80
720 : #endif
721 : #ifndef CO_ASYNC_GENERATOR
722 : #define CO_ASYNC_GENERATOR 0x200
723 : #endif
724 : #ifndef Py_TPFLAGS_CHECKTYPES
725 : #define Py_TPFLAGS_CHECKTYPES 0
726 : #endif
727 : #ifndef Py_TPFLAGS_HAVE_INDEX
728 : #define Py_TPFLAGS_HAVE_INDEX 0
729 : #endif
730 : #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
731 : #define Py_TPFLAGS_HAVE_NEWBUFFER 0
732 : #endif
733 : #ifndef Py_TPFLAGS_HAVE_FINALIZE
734 : #define Py_TPFLAGS_HAVE_FINALIZE 0
735 : #endif
736 : #ifndef Py_TPFLAGS_SEQUENCE
737 : #define Py_TPFLAGS_SEQUENCE 0
738 : #endif
739 : #ifndef Py_TPFLAGS_MAPPING
740 : #define Py_TPFLAGS_MAPPING 0
741 : #endif
742 : #ifndef METH_STACKLESS
743 : #define METH_STACKLESS 0
744 : #endif
745 : #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
746 : #ifndef METH_FASTCALL
747 : #define METH_FASTCALL 0x80
748 : #endif
749 : typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
750 : typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
751 : Py_ssize_t nargs, PyObject *kwnames);
752 : #else
753 : #if PY_VERSION_HEX >= 0x030d00A4
754 : # define __Pyx_PyCFunctionFast PyCFunctionFast
755 : # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
756 : #else
757 : # define __Pyx_PyCFunctionFast _PyCFunctionFast
758 : # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
759 : #endif
760 : #endif
761 : #if CYTHON_METH_FASTCALL
762 : #define __Pyx_METH_FASTCALL METH_FASTCALL
763 : #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
764 : #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
765 : #else
766 : #define __Pyx_METH_FASTCALL METH_VARARGS
767 : #define __Pyx_PyCFunction_FastCall PyCFunction
768 : #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
769 : #endif
770 : #if CYTHON_VECTORCALL
771 : #define __pyx_vectorcallfunc vectorcallfunc
772 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
773 : #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
774 : #elif CYTHON_BACKPORT_VECTORCALL
775 : typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
776 : size_t nargsf, PyObject *kwnames);
777 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
778 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
779 : #else
780 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
781 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
782 : #endif
783 : #if PY_MAJOR_VERSION >= 0x030900B1
784 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
785 : #else
786 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
787 : #endif
788 : #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
789 : #if CYTHON_COMPILING_IN_CPYTHON
790 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
791 : #elif !CYTHON_COMPILING_IN_LIMITED_API
792 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
793 : #endif
794 : #if CYTHON_COMPILING_IN_CPYTHON
795 : #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
796 0 : static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
797 0 : return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
798 : }
799 : #endif
800 : static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
801 : #if CYTHON_COMPILING_IN_LIMITED_API
802 : return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
803 : #else
804 : return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
805 : #endif
806 : }
807 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
808 : #if __PYX_LIMITED_VERSION_HEX < 0x030900B1
809 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
810 : typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
811 : #else
812 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
813 : #define __Pyx_PyCMethod PyCMethod
814 : #endif
815 : #ifndef METH_METHOD
816 : #define METH_METHOD 0x200
817 : #endif
818 : #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
819 : #define PyObject_Malloc(s) PyMem_Malloc(s)
820 : #define PyObject_Free(p) PyMem_Free(p)
821 : #define PyObject_Realloc(p) PyMem_Realloc(p)
822 : #endif
823 : #if CYTHON_COMPILING_IN_LIMITED_API
824 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
825 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
826 : #else
827 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
828 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
829 : #endif
830 : #if CYTHON_COMPILING_IN_LIMITED_API
831 : #define __Pyx_PyThreadState_Current PyThreadState_Get()
832 : #elif !CYTHON_FAST_THREAD_STATE
833 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
834 : #elif PY_VERSION_HEX >= 0x030d00A1
835 : #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
836 : #elif PY_VERSION_HEX >= 0x03060000
837 : #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
838 : #elif PY_VERSION_HEX >= 0x03000000
839 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
840 : #else
841 : #define __Pyx_PyThreadState_Current _PyThreadState_Current
842 : #endif
843 : #if CYTHON_COMPILING_IN_LIMITED_API
844 : static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
845 : {
846 : void *result;
847 : result = PyModule_GetState(op);
848 : if (!result)
849 : Py_FatalError("Couldn't find the module state");
850 : return result;
851 : }
852 : #endif
853 : #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
854 : #if CYTHON_COMPILING_IN_LIMITED_API
855 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
856 : #else
857 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
858 : #endif
859 : #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
860 : #include "pythread.h"
861 : #define Py_tss_NEEDS_INIT 0
862 : typedef int Py_tss_t;
863 : static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
864 : *key = PyThread_create_key();
865 : return 0;
866 : }
867 : static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
868 : Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
869 : *key = Py_tss_NEEDS_INIT;
870 : return key;
871 : }
872 : static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
873 : PyObject_Free(key);
874 : }
875 : static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
876 : return *key != Py_tss_NEEDS_INIT;
877 : }
878 : static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
879 : PyThread_delete_key(*key);
880 : *key = Py_tss_NEEDS_INIT;
881 : }
882 : static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
883 : return PyThread_set_key_value(*key, value);
884 : }
885 : static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
886 : return PyThread_get_key_value(*key);
887 : }
888 : #endif
889 : #if PY_MAJOR_VERSION < 3
890 : #if CYTHON_COMPILING_IN_PYPY
891 : #if PYPY_VERSION_NUM < 0x07030600
892 : #if defined(__cplusplus) && __cplusplus >= 201402L
893 : [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
894 : #elif defined(__GNUC__) || defined(__clang__)
895 : __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
896 : #elif defined(_MSC_VER)
897 : __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
898 : #endif
899 : static CYTHON_INLINE int PyGILState_Check(void) {
900 : return 0;
901 : }
902 : #else // PYPY_VERSION_NUM < 0x07030600
903 : #endif // PYPY_VERSION_NUM < 0x07030600
904 : #else
905 : static CYTHON_INLINE int PyGILState_Check(void) {
906 : PyThreadState * tstate = _PyThreadState_Current;
907 : return tstate && (tstate == PyGILState_GetThisThreadState());
908 : }
909 : #endif
910 : #endif
911 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
912 : #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
913 : #else
914 : #define __Pyx_PyDict_NewPresized(n) PyDict_New()
915 : #endif
916 : #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
917 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
918 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
919 : #else
920 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
921 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
922 : #endif
923 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
924 : #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
925 44 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
926 44 : PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
927 44 : if (res == NULL) PyErr_Clear();
928 44 : return res;
929 : }
930 : #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
931 : #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
932 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
933 : #else
934 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
935 : #if CYTHON_COMPILING_IN_PYPY
936 : return PyDict_GetItem(dict, name);
937 : #else
938 : PyDictEntry *ep;
939 : PyDictObject *mp = (PyDictObject*) dict;
940 : long hash = ((PyStringObject *) name)->ob_shash;
941 : assert(hash != -1);
942 : ep = (mp->ma_lookup)(mp, name, hash);
943 : if (ep == NULL) {
944 : return NULL;
945 : }
946 : return ep->me_value;
947 : #endif
948 : }
949 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
950 : #endif
951 : #if CYTHON_USE_TYPE_SLOTS
952 : #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
953 : #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
954 : #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
955 : #else
956 : #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
957 : #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
958 : #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
959 : #endif
960 : #if CYTHON_COMPILING_IN_LIMITED_API
961 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
962 : #else
963 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
964 : #endif
965 : #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
966 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
967 : PyTypeObject *type = Py_TYPE((PyObject*)obj);\
968 : assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
969 : PyObject_GC_Del(obj);\
970 : Py_DECREF(type);\
971 : }
972 : #else
973 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
974 : #endif
975 : #if CYTHON_COMPILING_IN_LIMITED_API
976 : #define CYTHON_PEP393_ENABLED 1
977 : #define __Pyx_PyUnicode_READY(op) (0)
978 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
979 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
980 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
981 : #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
982 : #define __Pyx_PyUnicode_DATA(u) ((void*)u)
983 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
984 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
985 : #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
986 : #define CYTHON_PEP393_ENABLED 1
987 : #if PY_VERSION_HEX >= 0x030C0000
988 : #define __Pyx_PyUnicode_READY(op) (0)
989 : #else
990 : #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
991 : 0 : _PyUnicode_Ready((PyObject *)(op)))
992 : #endif
993 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
994 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
995 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
996 : #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
997 : #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
998 : #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
999 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
1000 : #if PY_VERSION_HEX >= 0x030C0000
1001 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
1002 : #else
1003 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
1004 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
1005 : #else
1006 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1007 : #endif
1008 : #endif
1009 : #else
1010 : #define CYTHON_PEP393_ENABLED 0
1011 : #define PyUnicode_1BYTE_KIND 1
1012 : #define PyUnicode_2BYTE_KIND 2
1013 : #define PyUnicode_4BYTE_KIND 4
1014 : #define __Pyx_PyUnicode_READY(op) (0)
1015 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
1016 : #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
1017 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
1018 : #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
1019 : #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
1020 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
1021 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
1022 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
1023 : #endif
1024 : #if CYTHON_COMPILING_IN_PYPY
1025 : #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
1026 : #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
1027 : #else
1028 : #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
1029 : #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
1030 : PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
1031 : #endif
1032 : #if CYTHON_COMPILING_IN_PYPY
1033 : #if !defined(PyUnicode_DecodeUnicodeEscape)
1034 : #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
1035 : #endif
1036 : #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
1037 : #undef PyUnicode_Contains
1038 : #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1039 : #endif
1040 : #if !defined(PyByteArray_Check)
1041 : #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1042 : #endif
1043 : #if !defined(PyObject_Format)
1044 : #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1045 : #endif
1046 : #endif
1047 : #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
1048 : #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1049 : #if PY_MAJOR_VERSION >= 3
1050 : #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
1051 : #else
1052 : #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
1053 : #endif
1054 : #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
1055 : #define PyObject_ASCII(o) PyObject_Repr(o)
1056 : #endif
1057 : #if PY_MAJOR_VERSION >= 3
1058 : #define PyBaseString_Type PyUnicode_Type
1059 : #define PyStringObject PyUnicodeObject
1060 : #define PyString_Type PyUnicode_Type
1061 : #define PyString_Check PyUnicode_Check
1062 : #define PyString_CheckExact PyUnicode_CheckExact
1063 : #ifndef PyObject_Unicode
1064 : #define PyObject_Unicode PyObject_Str
1065 : #endif
1066 : #endif
1067 : #if PY_MAJOR_VERSION >= 3
1068 : #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
1069 : #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
1070 : #else
1071 : #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
1072 : #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
1073 : #endif
1074 : #if CYTHON_COMPILING_IN_CPYTHON
1075 : #define __Pyx_PySequence_ListKeepNew(obj)\
1076 : (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1077 : #else
1078 : #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1079 : #endif
1080 : #ifndef PySet_CheckExact
1081 : #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
1082 : #endif
1083 : #if PY_VERSION_HEX >= 0x030900A4
1084 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
1085 : #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
1086 : #else
1087 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
1088 : #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
1089 : #endif
1090 : #if CYTHON_ASSUME_SAFE_MACROS
1091 : #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1092 : #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1093 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1094 : #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1095 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1096 : #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1097 : #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1098 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1099 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1100 : #else
1101 : #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1102 : #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1103 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1104 : #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1105 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1106 : #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1107 : #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1108 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1109 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1110 : #endif
1111 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
1112 : #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
1113 : #else
1114 3 : static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
1115 3 : PyObject *module = PyImport_AddModule(name);
1116 3 : Py_XINCREF(module);
1117 3 : return module;
1118 : }
1119 : #endif
1120 : #if PY_MAJOR_VERSION >= 3
1121 : #define PyIntObject PyLongObject
1122 : #define PyInt_Type PyLong_Type
1123 : #define PyInt_Check(op) PyLong_Check(op)
1124 : #define PyInt_CheckExact(op) PyLong_CheckExact(op)
1125 : #define __Pyx_Py3Int_Check(op) PyLong_Check(op)
1126 : #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op)
1127 : #define PyInt_FromString PyLong_FromString
1128 : #define PyInt_FromUnicode PyLong_FromUnicode
1129 : #define PyInt_FromLong PyLong_FromLong
1130 : #define PyInt_FromSize_t PyLong_FromSize_t
1131 : #define PyInt_FromSsize_t PyLong_FromSsize_t
1132 : #define PyInt_AsLong PyLong_AsLong
1133 : #define PyInt_AS_LONG PyLong_AS_LONG
1134 : #define PyInt_AsSsize_t PyLong_AsSsize_t
1135 : #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
1136 : #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
1137 : #define PyNumber_Int PyNumber_Long
1138 : #else
1139 : #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
1140 : #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
1141 : #endif
1142 : #if PY_MAJOR_VERSION >= 3
1143 : #define PyBoolObject PyLongObject
1144 : #endif
1145 : #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
1146 : #ifndef PyUnicode_InternFromString
1147 : #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1148 : #endif
1149 : #endif
1150 : #if PY_VERSION_HEX < 0x030200A4
1151 : typedef long Py_hash_t;
1152 : #define __Pyx_PyInt_FromHash_t PyInt_FromLong
1153 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
1154 : #else
1155 : #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
1156 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
1157 : #endif
1158 : #if CYTHON_USE_ASYNC_SLOTS
1159 : #if PY_VERSION_HEX >= 0x030500B1
1160 : #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1161 : #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
1162 : #else
1163 : #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
1164 : #endif
1165 : #else
1166 : #define __Pyx_PyType_AsAsync(obj) NULL
1167 : #endif
1168 : #ifndef __Pyx_PyAsyncMethodsStruct
1169 : typedef struct {
1170 : unaryfunc am_await;
1171 : unaryfunc am_aiter;
1172 : unaryfunc am_anext;
1173 : } __Pyx_PyAsyncMethodsStruct;
1174 : #endif
1175 :
1176 : #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1177 : #if !defined(_USE_MATH_DEFINES)
1178 : #define _USE_MATH_DEFINES
1179 : #endif
1180 : #endif
1181 : #include <math.h>
1182 : #ifdef NAN
1183 : #define __PYX_NAN() ((float) NAN)
1184 : #else
1185 : static CYTHON_INLINE float __PYX_NAN() {
1186 : float value;
1187 : memset(&value, 0xFF, sizeof(value));
1188 : return value;
1189 : }
1190 : #endif
1191 : #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1192 : #define __Pyx_truncl trunc
1193 : #else
1194 : #define __Pyx_truncl truncl
1195 : #endif
1196 :
1197 : #define __PYX_MARK_ERR_POS(f_index, lineno) \
1198 : { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1199 : #define __PYX_ERR(f_index, lineno, Ln_error) \
1200 : { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1201 :
1202 : #ifdef CYTHON_EXTERN_C
1203 : #undef __PYX_EXTERN_C
1204 : #define __PYX_EXTERN_C CYTHON_EXTERN_C
1205 : #elif defined(__PYX_EXTERN_C)
1206 : #ifdef _MSC_VER
1207 : #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1208 : #else
1209 : #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1210 : #endif
1211 : #else
1212 : #ifdef __cplusplus
1213 : #define __PYX_EXTERN_C extern "C"
1214 : #else
1215 : #define __PYX_EXTERN_C extern
1216 : #endif
1217 : #endif
1218 :
1219 : #define __PYX_HAVE__scipy__sparse__csgraph___matching
1220 : #define __PYX_HAVE_API__scipy__sparse__csgraph___matching
1221 : /* Early includes */
1222 : #include <string.h>
1223 : #include <stdio.h>
1224 :
1225 : /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1226 :
1227 : #include "numpy/arrayobject.h"
1228 : #include "numpy/ndarrayobject.h"
1229 : #include "numpy/ndarraytypes.h"
1230 : #include "numpy/arrayscalars.h"
1231 : #include "numpy/ufuncobject.h"
1232 : #include <math.h>
1233 : #include "pythread.h"
1234 : #include <stdlib.h>
1235 : #ifdef _OPENMP
1236 : #include <omp.h>
1237 : #endif /* _OPENMP */
1238 :
1239 : #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1240 : #define CYTHON_WITHOUT_ASSERTIONS
1241 : #endif
1242 :
1243 : typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
1244 : const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
1245 :
1246 : #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1247 : #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1248 : #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
1249 : #define __PYX_DEFAULT_STRING_ENCODING ""
1250 : #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1251 : #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1252 : #define __Pyx_uchar_cast(c) ((unsigned char)c)
1253 : #define __Pyx_long_cast(x) ((long)x)
1254 : #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1255 : (sizeof(type) < sizeof(Py_ssize_t)) ||\
1256 : (sizeof(type) > sizeof(Py_ssize_t) &&\
1257 : likely(v < (type)PY_SSIZE_T_MAX ||\
1258 : v == (type)PY_SSIZE_T_MAX) &&\
1259 : (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1260 : v == (type)PY_SSIZE_T_MIN))) ||\
1261 : (sizeof(type) == sizeof(Py_ssize_t) &&\
1262 : (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1263 : v == (type)PY_SSIZE_T_MAX))) )
1264 0 : static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1265 0 : return (size_t) i < (size_t) limit;
1266 : }
1267 : #if defined (__cplusplus) && __cplusplus >= 201103L
1268 : #include <cstdlib>
1269 : #define __Pyx_sst_abs(value) std::abs(value)
1270 : #elif SIZEOF_INT >= SIZEOF_SIZE_T
1271 : #define __Pyx_sst_abs(value) abs(value)
1272 : #elif SIZEOF_LONG >= SIZEOF_SIZE_T
1273 : #define __Pyx_sst_abs(value) labs(value)
1274 : #elif defined (_MSC_VER)
1275 : #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1276 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1277 : #define __Pyx_sst_abs(value) llabs(value)
1278 : #elif defined (__GNUC__)
1279 : #define __Pyx_sst_abs(value) __builtin_llabs(value)
1280 : #else
1281 : #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1282 : #endif
1283 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1284 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1285 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1286 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1287 : #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1288 : #define __Pyx_PyBytes_FromString PyBytes_FromString
1289 : #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1290 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1291 : #if PY_MAJOR_VERSION < 3
1292 : #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1293 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1294 : #else
1295 : #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1296 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1297 : #endif
1298 : #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1299 : #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1300 : #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1301 : #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1302 : #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1303 : #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1304 : #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1305 : #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1306 : #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1307 : #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1308 : #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1309 : #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1310 : #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1311 : #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1312 : #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1313 : #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1314 : #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1315 : #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1316 : #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1317 : #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1318 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1319 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1320 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1321 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1322 : #define __Pyx_PySequence_Tuple(obj)\
1323 : (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1324 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1325 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1326 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1327 : #if CYTHON_ASSUME_SAFE_MACROS
1328 : #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1329 : #else
1330 : #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1331 : #endif
1332 : #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1333 : #if PY_MAJOR_VERSION >= 3
1334 : #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1335 : #else
1336 : #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1337 : #endif
1338 : #if CYTHON_USE_PYLONG_INTERNALS
1339 : #if PY_VERSION_HEX >= 0x030C00A7
1340 : #ifndef _PyLong_SIGN_MASK
1341 : #define _PyLong_SIGN_MASK 3
1342 : #endif
1343 : #ifndef _PyLong_NON_SIZE_BITS
1344 : #define _PyLong_NON_SIZE_BITS 3
1345 : #endif
1346 : #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
1347 : #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
1348 : #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1349 : #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
1350 : #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
1351 : #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1352 : #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1353 : #define __Pyx_PyLong_SignedDigitCount(x)\
1354 : ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1355 : #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1356 : #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1357 : #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1358 : #else
1359 : #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1360 : #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1361 : #endif
1362 : typedef Py_ssize_t __Pyx_compact_pylong;
1363 : typedef size_t __Pyx_compact_upylong;
1364 : #else
1365 : #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1366 : #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1367 : #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1368 : #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1369 : #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1370 : #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1371 : #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1372 : #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1373 : #define __Pyx_PyLong_CompactValue(x)\
1374 : ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1375 : typedef sdigit __Pyx_compact_pylong;
1376 : typedef digit __Pyx_compact_upylong;
1377 : #endif
1378 : #if PY_VERSION_HEX >= 0x030C00A5
1379 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1380 : #else
1381 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1382 : #endif
1383 : #endif
1384 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1385 : #include <string.h>
1386 : static int __Pyx_sys_getdefaultencoding_not_ascii;
1387 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1388 : PyObject* sys;
1389 : PyObject* default_encoding = NULL;
1390 : PyObject* ascii_chars_u = NULL;
1391 : PyObject* ascii_chars_b = NULL;
1392 : const char* default_encoding_c;
1393 : sys = PyImport_ImportModule("sys");
1394 : if (!sys) goto bad;
1395 : default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1396 : Py_DECREF(sys);
1397 : if (!default_encoding) goto bad;
1398 : default_encoding_c = PyBytes_AsString(default_encoding);
1399 : if (!default_encoding_c) goto bad;
1400 : if (strcmp(default_encoding_c, "ascii") == 0) {
1401 : __Pyx_sys_getdefaultencoding_not_ascii = 0;
1402 : } else {
1403 : char ascii_chars[128];
1404 : int c;
1405 : for (c = 0; c < 128; c++) {
1406 : ascii_chars[c] = (char) c;
1407 : }
1408 : __Pyx_sys_getdefaultencoding_not_ascii = 1;
1409 : ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1410 : if (!ascii_chars_u) goto bad;
1411 : ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1412 : if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1413 : PyErr_Format(
1414 : PyExc_ValueError,
1415 : "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1416 : default_encoding_c);
1417 : goto bad;
1418 : }
1419 : Py_DECREF(ascii_chars_u);
1420 : Py_DECREF(ascii_chars_b);
1421 : }
1422 : Py_DECREF(default_encoding);
1423 : return 0;
1424 : bad:
1425 : Py_XDECREF(default_encoding);
1426 : Py_XDECREF(ascii_chars_u);
1427 : Py_XDECREF(ascii_chars_b);
1428 : return -1;
1429 : }
1430 : #endif
1431 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1432 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1433 : #else
1434 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1435 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1436 : #include <string.h>
1437 : static char* __PYX_DEFAULT_STRING_ENCODING;
1438 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1439 : PyObject* sys;
1440 : PyObject* default_encoding = NULL;
1441 : char* default_encoding_c;
1442 : sys = PyImport_ImportModule("sys");
1443 : if (!sys) goto bad;
1444 : default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1445 : Py_DECREF(sys);
1446 : if (!default_encoding) goto bad;
1447 : default_encoding_c = PyBytes_AsString(default_encoding);
1448 : if (!default_encoding_c) goto bad;
1449 : __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1450 : if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1451 : strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1452 : Py_DECREF(default_encoding);
1453 : return 0;
1454 : bad:
1455 : Py_XDECREF(default_encoding);
1456 : return -1;
1457 : }
1458 : #endif
1459 : #endif
1460 :
1461 :
1462 : /* Test for GCC > 2.95 */
1463 : #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1464 : #define likely(x) __builtin_expect(!!(x), 1)
1465 : #define unlikely(x) __builtin_expect(!!(x), 0)
1466 : #else /* !__GNUC__ or GCC < 2.95 */
1467 : #define likely(x) (x)
1468 : #define unlikely(x) (x)
1469 : #endif /* __GNUC__ */
1470 : static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1471 :
1472 : #if !CYTHON_USE_MODULE_STATE
1473 : static PyObject *__pyx_m = NULL;
1474 : #endif
1475 : static int __pyx_lineno;
1476 : static int __pyx_clineno = 0;
1477 : static const char * __pyx_cfilenm = __FILE__;
1478 : static const char *__pyx_filename;
1479 :
1480 : /* Header.proto */
1481 : #if !defined(CYTHON_CCOMPLEX)
1482 : #if defined(__cplusplus)
1483 : #define CYTHON_CCOMPLEX 1
1484 : #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1485 : #define CYTHON_CCOMPLEX 1
1486 : #else
1487 : #define CYTHON_CCOMPLEX 0
1488 : #endif
1489 : #endif
1490 : #if CYTHON_CCOMPLEX
1491 : #ifdef __cplusplus
1492 : #include <complex>
1493 : #else
1494 : #include <complex.h>
1495 : #endif
1496 : #endif
1497 : #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1498 : #undef _Complex_I
1499 : #define _Complex_I 1.0fj
1500 : #endif
1501 :
1502 : /* #### Code section: filename_table ### */
1503 :
1504 : static const char *__pyx_f[] = {
1505 : "_matching.pyx",
1506 : "<stringsource>",
1507 : "__init__.cython-30.pxd",
1508 : "type.pxd",
1509 : "parameters.pxi",
1510 : };
1511 : /* #### Code section: utility_code_proto_before_types ### */
1512 : /* ForceInitThreads.proto */
1513 : #ifndef __PYX_FORCE_INIT_THREADS
1514 : #define __PYX_FORCE_INIT_THREADS 0
1515 : #endif
1516 :
1517 : /* NoFastGil.proto */
1518 : #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1519 : #define __Pyx_PyGILState_Release PyGILState_Release
1520 : #define __Pyx_FastGIL_Remember()
1521 : #define __Pyx_FastGIL_Forget()
1522 : #define __Pyx_FastGilFuncInit()
1523 :
1524 : /* BufferFormatStructs.proto */
1525 : struct __Pyx_StructField_;
1526 : #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1527 : typedef struct {
1528 : const char* name;
1529 : struct __Pyx_StructField_* fields;
1530 : size_t size;
1531 : size_t arraysize[8];
1532 : int ndim;
1533 : char typegroup;
1534 : char is_unsigned;
1535 : int flags;
1536 : } __Pyx_TypeInfo;
1537 : typedef struct __Pyx_StructField_ {
1538 : __Pyx_TypeInfo* type;
1539 : const char* name;
1540 : size_t offset;
1541 : } __Pyx_StructField;
1542 : typedef struct {
1543 : __Pyx_StructField* field;
1544 : size_t parent_offset;
1545 : } __Pyx_BufFmt_StackElem;
1546 : typedef struct {
1547 : __Pyx_StructField root;
1548 : __Pyx_BufFmt_StackElem* head;
1549 : size_t fmt_offset;
1550 : size_t new_count, enc_count;
1551 : size_t struct_alignment;
1552 : int is_complex;
1553 : char enc_type;
1554 : char new_packmode;
1555 : char enc_packmode;
1556 : char is_valid_array;
1557 : } __Pyx_BufFmt_Context;
1558 :
1559 : /* Atomics.proto */
1560 : #include <pythread.h>
1561 : #ifndef CYTHON_ATOMICS
1562 : #define CYTHON_ATOMICS 1
1563 : #endif
1564 : #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1565 : #define __pyx_atomic_int_type int
1566 : #define __pyx_nonatomic_int_type int
1567 : #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1568 : (__STDC_VERSION__ >= 201112L) &&\
1569 : !defined(__STDC_NO_ATOMICS__))
1570 : #include <stdatomic.h>
1571 : #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1572 : (__cplusplus >= 201103L) ||\
1573 : (defined(_MSC_VER) && _MSC_VER >= 1700)))
1574 : #include <atomic>
1575 : #endif
1576 : #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1577 : (__STDC_VERSION__ >= 201112L) &&\
1578 : !defined(__STDC_NO_ATOMICS__) &&\
1579 : ATOMIC_INT_LOCK_FREE == 2)
1580 : #undef __pyx_atomic_int_type
1581 : #define __pyx_atomic_int_type atomic_int
1582 : #define __pyx_atomic_incr_aligned(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1583 : #define __pyx_atomic_decr_aligned(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1584 : #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1585 : #pragma message ("Using standard C atomics")
1586 : #elif defined(__PYX_DEBUG_ATOMICS)
1587 : #warning "Using standard C atomics"
1588 : #endif
1589 : #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1590 : (__cplusplus >= 201103L) ||\
1591 : \
1592 : (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1593 : ATOMIC_INT_LOCK_FREE == 2)
1594 : #undef __pyx_atomic_int_type
1595 : #define __pyx_atomic_int_type std::atomic_int
1596 : #define __pyx_atomic_incr_aligned(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1597 : #define __pyx_atomic_decr_aligned(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1598 : #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1599 : #pragma message ("Using standard C++ atomics")
1600 : #elif defined(__PYX_DEBUG_ATOMICS)
1601 : #warning "Using standard C++ atomics"
1602 : #endif
1603 : #elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1604 : (__GNUC_MINOR__ > 1 ||\
1605 : (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1606 : #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1607 : #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1608 : #ifdef __PYX_DEBUG_ATOMICS
1609 : #warning "Using GNU atomics"
1610 : #endif
1611 : #elif CYTHON_ATOMICS && defined(_MSC_VER)
1612 : #include <intrin.h>
1613 : #undef __pyx_atomic_int_type
1614 : #define __pyx_atomic_int_type long
1615 : #undef __pyx_nonatomic_int_type
1616 : #define __pyx_nonatomic_int_type long
1617 : #pragma intrinsic (_InterlockedExchangeAdd)
1618 : #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1619 : #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1620 : #ifdef __PYX_DEBUG_ATOMICS
1621 : #pragma message ("Using MSVC atomics")
1622 : #endif
1623 : #else
1624 : #undef CYTHON_ATOMICS
1625 : #define CYTHON_ATOMICS 0
1626 : #ifdef __PYX_DEBUG_ATOMICS
1627 : #warning "Not using atomics"
1628 : #endif
1629 : #endif
1630 : #if CYTHON_ATOMICS
1631 : #define __pyx_add_acquisition_count(memview)\
1632 : __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1633 : #define __pyx_sub_acquisition_count(memview)\
1634 : __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1635 : #else
1636 : #define __pyx_add_acquisition_count(memview)\
1637 : __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1638 : #define __pyx_sub_acquisition_count(memview)\
1639 : __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1640 : #endif
1641 :
1642 : /* MemviewSliceStruct.proto */
1643 : struct __pyx_memoryview_obj;
1644 : typedef struct {
1645 : struct __pyx_memoryview_obj *memview;
1646 : char *data;
1647 : Py_ssize_t shape[8];
1648 : Py_ssize_t strides[8];
1649 : Py_ssize_t suboffsets[8];
1650 : } __Pyx_memviewslice;
1651 : #define __Pyx_MemoryView_Len(m) (m.shape[0])
1652 :
1653 : /* #### Code section: numeric_typedefs ### */
1654 :
1655 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":769
1656 : * # in Cython to enable them only on the right systems.
1657 : *
1658 : * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1659 : * ctypedef npy_int16 int16_t
1660 : * ctypedef npy_int32 int32_t
1661 : */
1662 : typedef npy_int8 __pyx_t_5numpy_int8_t;
1663 :
1664 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":770
1665 : *
1666 : * ctypedef npy_int8 int8_t
1667 : * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1668 : * ctypedef npy_int32 int32_t
1669 : * ctypedef npy_int64 int64_t
1670 : */
1671 : typedef npy_int16 __pyx_t_5numpy_int16_t;
1672 :
1673 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":771
1674 : * ctypedef npy_int8 int8_t
1675 : * ctypedef npy_int16 int16_t
1676 : * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1677 : * ctypedef npy_int64 int64_t
1678 : * #ctypedef npy_int96 int96_t
1679 : */
1680 : typedef npy_int32 __pyx_t_5numpy_int32_t;
1681 :
1682 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":772
1683 : * ctypedef npy_int16 int16_t
1684 : * ctypedef npy_int32 int32_t
1685 : * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1686 : * #ctypedef npy_int96 int96_t
1687 : * #ctypedef npy_int128 int128_t
1688 : */
1689 : typedef npy_int64 __pyx_t_5numpy_int64_t;
1690 :
1691 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":776
1692 : * #ctypedef npy_int128 int128_t
1693 : *
1694 : * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1695 : * ctypedef npy_uint16 uint16_t
1696 : * ctypedef npy_uint32 uint32_t
1697 : */
1698 : typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1699 :
1700 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":777
1701 : *
1702 : * ctypedef npy_uint8 uint8_t
1703 : * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1704 : * ctypedef npy_uint32 uint32_t
1705 : * ctypedef npy_uint64 uint64_t
1706 : */
1707 : typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1708 :
1709 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":778
1710 : * ctypedef npy_uint8 uint8_t
1711 : * ctypedef npy_uint16 uint16_t
1712 : * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1713 : * ctypedef npy_uint64 uint64_t
1714 : * #ctypedef npy_uint96 uint96_t
1715 : */
1716 : typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1717 :
1718 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779
1719 : * ctypedef npy_uint16 uint16_t
1720 : * ctypedef npy_uint32 uint32_t
1721 : * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1722 : * #ctypedef npy_uint96 uint96_t
1723 : * #ctypedef npy_uint128 uint128_t
1724 : */
1725 : typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1726 :
1727 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":783
1728 : * #ctypedef npy_uint128 uint128_t
1729 : *
1730 : * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1731 : * ctypedef npy_float64 float64_t
1732 : * #ctypedef npy_float80 float80_t
1733 : */
1734 : typedef npy_float32 __pyx_t_5numpy_float32_t;
1735 :
1736 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":784
1737 : *
1738 : * ctypedef npy_float32 float32_t
1739 : * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1740 : * #ctypedef npy_float80 float80_t
1741 : * #ctypedef npy_float128 float128_t
1742 : */
1743 : typedef npy_float64 __pyx_t_5numpy_float64_t;
1744 :
1745 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":791
1746 : * ctypedef double complex complex128_t
1747 : *
1748 : * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1749 : * ctypedef npy_ulonglong ulonglong_t
1750 : *
1751 : */
1752 : typedef npy_longlong __pyx_t_5numpy_longlong_t;
1753 :
1754 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":792
1755 : *
1756 : * ctypedef npy_longlong longlong_t
1757 : * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1758 : *
1759 : * ctypedef npy_intp intp_t
1760 : */
1761 : typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1762 :
1763 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":794
1764 : * ctypedef npy_ulonglong ulonglong_t
1765 : *
1766 : * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1767 : * ctypedef npy_uintp uintp_t
1768 : *
1769 : */
1770 : typedef npy_intp __pyx_t_5numpy_intp_t;
1771 :
1772 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":795
1773 : *
1774 : * ctypedef npy_intp intp_t
1775 : * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1776 : *
1777 : * ctypedef npy_double float_t
1778 : */
1779 : typedef npy_uintp __pyx_t_5numpy_uintp_t;
1780 :
1781 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":797
1782 : * ctypedef npy_uintp uintp_t
1783 : *
1784 : * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1785 : * ctypedef npy_double double_t
1786 : * ctypedef npy_longdouble longdouble_t
1787 : */
1788 : typedef npy_double __pyx_t_5numpy_float_t;
1789 :
1790 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":798
1791 : *
1792 : * ctypedef npy_double float_t
1793 : * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1794 : * ctypedef npy_longdouble longdouble_t
1795 : *
1796 : */
1797 : typedef npy_double __pyx_t_5numpy_double_t;
1798 :
1799 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":799
1800 : * ctypedef npy_double float_t
1801 : * ctypedef npy_double double_t
1802 : * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1803 : *
1804 : * ctypedef float complex cfloat_t
1805 : */
1806 : typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1807 :
1808 : /* "../scipy/sparse/csgraph/parameters.pxi":3
1809 : *
1810 : * DTYPE = np.float64
1811 : * ctypedef np.float64_t DTYPE_t # <<<<<<<<<<<<<<
1812 : *
1813 : * ITYPE = np.int32
1814 : */
1815 : typedef __pyx_t_5numpy_float64_t __pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t;
1816 :
1817 : /* "../scipy/sparse/csgraph/parameters.pxi":6
1818 : *
1819 : * ITYPE = np.int32
1820 : * ctypedef np.int32_t ITYPE_t # <<<<<<<<<<<<<<
1821 : *
1822 : * # Fused type for int32 and int64
1823 : */
1824 : typedef __pyx_t_5numpy_int32_t __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t;
1825 :
1826 : /* "scipy/sparse/csgraph/_matching.pyx":523
1827 : * # We will use uint8 to represent booleans to simplify arrays of booleans below.
1828 : * BTYPE = np.uint8
1829 : * ctypedef np.uint8_t BTYPE_t # <<<<<<<<<<<<<<
1830 : *
1831 : *
1832 : */
1833 : typedef __pyx_t_5numpy_uint8_t __pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t;
1834 : /* #### Code section: complex_type_declarations ### */
1835 : /* Declarations.proto */
1836 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1837 : #ifdef __cplusplus
1838 : typedef ::std::complex< float > __pyx_t_float_complex;
1839 : #else
1840 : typedef float _Complex __pyx_t_float_complex;
1841 : #endif
1842 : #else
1843 : typedef struct { float real, imag; } __pyx_t_float_complex;
1844 : #endif
1845 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1846 :
1847 : /* Declarations.proto */
1848 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1849 : #ifdef __cplusplus
1850 : typedef ::std::complex< double > __pyx_t_double_complex;
1851 : #else
1852 : typedef double _Complex __pyx_t_double_complex;
1853 : #endif
1854 : #else
1855 : typedef struct { double real, imag; } __pyx_t_double_complex;
1856 : #endif
1857 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1858 :
1859 : /* Declarations.proto */
1860 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1861 : #ifdef __cplusplus
1862 : typedef ::std::complex< long double > __pyx_t_long_double_complex;
1863 : #else
1864 : typedef long double _Complex __pyx_t_long_double_complex;
1865 : #endif
1866 : #else
1867 : typedef struct { long double real, imag; } __pyx_t_long_double_complex;
1868 : #endif
1869 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
1870 :
1871 : /* #### Code section: type_declarations ### */
1872 :
1873 : /*--- Type declarations ---*/
1874 : struct __pyx_array_obj;
1875 : struct __pyx_MemviewEnum_obj;
1876 : struct __pyx_memoryview_obj;
1877 : struct __pyx_memoryviewslice_obj;
1878 :
1879 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1095
1880 : *
1881 : * # Iterator API added in v1.6
1882 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil # <<<<<<<<<<<<<<
1883 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil
1884 : *
1885 : */
1886 : typedef int (*__pyx_t_5numpy_NpyIter_IterNextFunc)(NpyIter *);
1887 :
1888 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1096
1889 : * # Iterator API added in v1.6
1890 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil
1891 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil # <<<<<<<<<<<<<<
1892 : *
1893 : * cdef extern from "numpy/arrayobject.h":
1894 : */
1895 : typedef void (*__pyx_t_5numpy_NpyIter_GetMultiIndexFunc)(NpyIter *, npy_intp *);
1896 :
1897 : /* "View.MemoryView":114
1898 : * @cython.collection_type("sequence")
1899 : * @cname("__pyx_array")
1900 : * cdef class array: # <<<<<<<<<<<<<<
1901 : *
1902 : * cdef:
1903 : */
1904 : struct __pyx_array_obj {
1905 : PyObject_HEAD
1906 : struct __pyx_vtabstruct_array *__pyx_vtab;
1907 : char *data;
1908 : Py_ssize_t len;
1909 : char *format;
1910 : int ndim;
1911 : Py_ssize_t *_shape;
1912 : Py_ssize_t *_strides;
1913 : Py_ssize_t itemsize;
1914 : PyObject *mode;
1915 : PyObject *_format;
1916 : void (*callback_free_data)(void *);
1917 : int free_data;
1918 : int dtype_is_object;
1919 : };
1920 :
1921 :
1922 : /* "View.MemoryView":302
1923 : *
1924 : * @cname('__pyx_MemviewEnum')
1925 : * cdef class Enum(object): # <<<<<<<<<<<<<<
1926 : * cdef object name
1927 : * def __init__(self, name):
1928 : */
1929 : struct __pyx_MemviewEnum_obj {
1930 : PyObject_HEAD
1931 : PyObject *name;
1932 : };
1933 :
1934 :
1935 : /* "View.MemoryView":337
1936 : *
1937 : * @cname('__pyx_memoryview')
1938 : * cdef class memoryview: # <<<<<<<<<<<<<<
1939 : *
1940 : * cdef object obj
1941 : */
1942 : struct __pyx_memoryview_obj {
1943 : PyObject_HEAD
1944 : struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1945 : PyObject *obj;
1946 : PyObject *_size;
1947 : PyObject *_array_interface;
1948 : PyThread_type_lock lock;
1949 : __pyx_atomic_int_type acquisition_count;
1950 : Py_buffer view;
1951 : int flags;
1952 : int dtype_is_object;
1953 : __Pyx_TypeInfo *typeinfo;
1954 : };
1955 :
1956 :
1957 : /* "View.MemoryView":952
1958 : * @cython.collection_type("sequence")
1959 : * @cname('__pyx_memoryviewslice')
1960 : * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1961 : * "Internal class for passing memoryview slices to Python"
1962 : *
1963 : */
1964 : struct __pyx_memoryviewslice_obj {
1965 : struct __pyx_memoryview_obj __pyx_base;
1966 : __Pyx_memviewslice from_slice;
1967 : PyObject *from_object;
1968 : PyObject *(*to_object_func)(char *);
1969 : int (*to_dtype_func)(char *, PyObject *);
1970 : };
1971 :
1972 :
1973 :
1974 : /* "View.MemoryView":114
1975 : * @cython.collection_type("sequence")
1976 : * @cname("__pyx_array")
1977 : * cdef class array: # <<<<<<<<<<<<<<
1978 : *
1979 : * cdef:
1980 : */
1981 :
1982 : struct __pyx_vtabstruct_array {
1983 : PyObject *(*get_memview)(struct __pyx_array_obj *);
1984 : };
1985 : static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1986 :
1987 :
1988 : /* "View.MemoryView":337
1989 : *
1990 : * @cname('__pyx_memoryview')
1991 : * cdef class memoryview: # <<<<<<<<<<<<<<
1992 : *
1993 : * cdef object obj
1994 : */
1995 :
1996 : struct __pyx_vtabstruct_memoryview {
1997 : char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1998 : PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1999 : PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2000 : PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
2001 : PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2002 : PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
2003 : PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
2004 : PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
2005 : };
2006 : static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2007 :
2008 :
2009 : /* "View.MemoryView":952
2010 : * @cython.collection_type("sequence")
2011 : * @cname('__pyx_memoryviewslice')
2012 : * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
2013 : * "Internal class for passing memoryview slices to Python"
2014 : *
2015 : */
2016 :
2017 : struct __pyx_vtabstruct__memoryviewslice {
2018 : struct __pyx_vtabstruct_memoryview __pyx_base;
2019 : };
2020 : static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2021 : /* #### Code section: utility_code_proto ### */
2022 :
2023 : /* --- Runtime support code (head) --- */
2024 : /* Refnanny.proto */
2025 : #ifndef CYTHON_REFNANNY
2026 : #define CYTHON_REFNANNY 0
2027 : #endif
2028 : #if CYTHON_REFNANNY
2029 : typedef struct {
2030 : void (*INCREF)(void*, PyObject*, Py_ssize_t);
2031 : void (*DECREF)(void*, PyObject*, Py_ssize_t);
2032 : void (*GOTREF)(void*, PyObject*, Py_ssize_t);
2033 : void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
2034 : void* (*SetupContext)(const char*, Py_ssize_t, const char*);
2035 : void (*FinishContext)(void**);
2036 : } __Pyx_RefNannyAPIStruct;
2037 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2038 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2039 : #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2040 : #ifdef WITH_THREAD
2041 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2042 : if (acquire_gil) {\
2043 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2044 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2045 : PyGILState_Release(__pyx_gilstate_save);\
2046 : } else {\
2047 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2048 : }
2049 : #define __Pyx_RefNannyFinishContextNogil() {\
2050 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2051 : __Pyx_RefNannyFinishContext();\
2052 : PyGILState_Release(__pyx_gilstate_save);\
2053 : }
2054 : #else
2055 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2056 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
2057 : #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
2058 : #endif
2059 : #define __Pyx_RefNannyFinishContextNogil() {\
2060 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2061 : __Pyx_RefNannyFinishContext();\
2062 : PyGILState_Release(__pyx_gilstate_save);\
2063 : }
2064 : #define __Pyx_RefNannyFinishContext()\
2065 : __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2066 : #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2067 : #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2068 : #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2069 : #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2070 : #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2071 : #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2072 : #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2073 : #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2074 : #else
2075 : #define __Pyx_RefNannyDeclarations
2076 : #define __Pyx_RefNannySetupContext(name, acquire_gil)
2077 : #define __Pyx_RefNannyFinishContextNogil()
2078 : #define __Pyx_RefNannyFinishContext()
2079 : #define __Pyx_INCREF(r) Py_INCREF(r)
2080 : #define __Pyx_DECREF(r) Py_DECREF(r)
2081 : #define __Pyx_GOTREF(r)
2082 : #define __Pyx_GIVEREF(r)
2083 : #define __Pyx_XINCREF(r) Py_XINCREF(r)
2084 : #define __Pyx_XDECREF(r) Py_XDECREF(r)
2085 : #define __Pyx_XGOTREF(r)
2086 : #define __Pyx_XGIVEREF(r)
2087 : #endif
2088 : #define __Pyx_Py_XDECREF_SET(r, v) do {\
2089 : PyObject *tmp = (PyObject *) r;\
2090 : r = v; Py_XDECREF(tmp);\
2091 : } while (0)
2092 : #define __Pyx_XDECREF_SET(r, v) do {\
2093 : PyObject *tmp = (PyObject *) r;\
2094 : r = v; __Pyx_XDECREF(tmp);\
2095 : } while (0)
2096 : #define __Pyx_DECREF_SET(r, v) do {\
2097 : PyObject *tmp = (PyObject *) r;\
2098 : r = v; __Pyx_DECREF(tmp);\
2099 : } while (0)
2100 : #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2101 : #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2102 :
2103 : /* PyErrExceptionMatches.proto */
2104 : #if CYTHON_FAST_THREAD_STATE
2105 : #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2106 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2107 : #else
2108 : #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2109 : #endif
2110 :
2111 : /* PyThreadStateGet.proto */
2112 : #if CYTHON_FAST_THREAD_STATE
2113 : #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2114 : #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2115 : #if PY_VERSION_HEX >= 0x030C00A6
2116 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2117 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2118 : #else
2119 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2120 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2121 : #endif
2122 : #else
2123 : #define __Pyx_PyThreadState_declare
2124 : #define __Pyx_PyThreadState_assign
2125 : #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2126 : #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2127 : #endif
2128 :
2129 : /* PyErrFetchRestore.proto */
2130 : #if CYTHON_FAST_THREAD_STATE
2131 : #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2132 : #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2133 : #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2134 : #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2135 : #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2136 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2137 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2138 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2139 : #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2140 : #else
2141 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2142 : #endif
2143 : #else
2144 : #define __Pyx_PyErr_Clear() PyErr_Clear()
2145 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2146 : #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2147 : #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2148 : #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2149 : #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2150 : #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2151 : #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2152 : #endif
2153 :
2154 : /* PyObjectGetAttrStr.proto */
2155 : #if CYTHON_USE_TYPE_SLOTS
2156 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2157 : #else
2158 : #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2159 : #endif
2160 :
2161 : /* PyObjectGetAttrStrNoError.proto */
2162 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2163 :
2164 : /* GetBuiltinName.proto */
2165 : static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2166 :
2167 : /* TupleAndListFromArray.proto */
2168 : #if CYTHON_COMPILING_IN_CPYTHON
2169 : static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2170 : static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2171 : #endif
2172 :
2173 : /* IncludeStringH.proto */
2174 : #include <string.h>
2175 :
2176 : /* BytesEquals.proto */
2177 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2178 :
2179 : /* UnicodeEquals.proto */
2180 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2181 :
2182 : /* fastcall.proto */
2183 : #if CYTHON_AVOID_BORROWED_REFS
2184 : #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
2185 : #elif CYTHON_ASSUME_SAFE_MACROS
2186 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
2187 : #else
2188 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
2189 : #endif
2190 : #if CYTHON_AVOID_BORROWED_REFS
2191 : #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
2192 : #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
2193 : #else
2194 : #define __Pyx_Arg_NewRef_VARARGS(arg) arg
2195 : #define __Pyx_Arg_XDECREF_VARARGS(arg)
2196 : #endif
2197 : #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2198 : #define __Pyx_KwValues_VARARGS(args, nargs) NULL
2199 : #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2200 : #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2201 : #if CYTHON_METH_FASTCALL
2202 : #define __Pyx_Arg_FASTCALL(args, i) args[i]
2203 : #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
2204 : #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2205 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2206 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2207 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2208 : #else
2209 : #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2210 : #endif
2211 : #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
2212 : to have the same reference counting */
2213 : #define __Pyx_Arg_XDECREF_FASTCALL(arg)
2214 : #else
2215 : #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
2216 : #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2217 : #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2218 : #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2219 : #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2220 : #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
2221 : #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
2222 : #endif
2223 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2224 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
2225 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
2226 : #else
2227 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2228 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
2229 : #endif
2230 :
2231 : /* RaiseArgTupleInvalid.proto */
2232 : static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2233 : Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2234 :
2235 : /* RaiseDoubleKeywords.proto */
2236 : static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2237 :
2238 : /* ParseKeywords.proto */
2239 : static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
2240 : PyObject **argnames[],
2241 : PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
2242 : const char* function_name);
2243 :
2244 : /* ArgTypeTest.proto */
2245 : #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2246 : ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2247 : __Pyx__ArgTypeTest(obj, type, name, exact))
2248 : static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2249 :
2250 : /* RaiseException.proto */
2251 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2252 :
2253 : /* PyFunctionFastCall.proto */
2254 : #if CYTHON_FAST_PYCALL
2255 : #if !CYTHON_VECTORCALL
2256 : #define __Pyx_PyFunction_FastCall(func, args, nargs)\
2257 : __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
2258 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2259 : #endif
2260 : #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2261 : (sizeof(char [1 - 2*!(cond)]) - 1)
2262 : #ifndef Py_MEMBER_SIZE
2263 : #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2264 : #endif
2265 : #if !CYTHON_VECTORCALL
2266 : #if PY_VERSION_HEX >= 0x03080000
2267 : #include "frameobject.h"
2268 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
2269 : #ifndef Py_BUILD_CORE
2270 : #define Py_BUILD_CORE 1
2271 : #endif
2272 : #include "internal/pycore_frame.h"
2273 : #endif
2274 : #define __Pxy_PyFrame_Initialize_Offsets()
2275 : #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
2276 : #else
2277 : static size_t __pyx_pyframe_localsplus_offset = 0;
2278 : #include "frameobject.h"
2279 : #define __Pxy_PyFrame_Initialize_Offsets()\
2280 : ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2281 : (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2282 : #define __Pyx_PyFrame_GetLocalsplus(frame)\
2283 : (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2284 : #endif
2285 : #endif
2286 : #endif
2287 :
2288 : /* PyObjectCall.proto */
2289 : #if CYTHON_COMPILING_IN_CPYTHON
2290 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2291 : #else
2292 : #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2293 : #endif
2294 :
2295 : /* PyObjectCallMethO.proto */
2296 : #if CYTHON_COMPILING_IN_CPYTHON
2297 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2298 : #endif
2299 :
2300 : /* PyObjectFastCall.proto */
2301 : #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2302 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
2303 :
2304 : /* RaiseUnexpectedTypeError.proto */
2305 : static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
2306 :
2307 : /* GCCDiagnostics.proto */
2308 : #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2309 : #define __Pyx_HAS_GCC_DIAGNOSTIC
2310 : #endif
2311 :
2312 : /* BuildPyUnicode.proto */
2313 : static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
2314 : int prepend_sign, char padding_char);
2315 :
2316 : /* CIntToPyUnicode.proto */
2317 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
2318 :
2319 : /* CIntToPyUnicode.proto */
2320 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
2321 :
2322 : /* JoinPyUnicode.proto */
2323 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
2324 : Py_UCS4 max_char);
2325 :
2326 : /* StrEquals.proto */
2327 : #if PY_MAJOR_VERSION >= 3
2328 : #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2329 : #else
2330 : #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2331 : #endif
2332 :
2333 : /* PyObjectFormatSimple.proto */
2334 : #if CYTHON_COMPILING_IN_PYPY
2335 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2336 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2337 : PyObject_Format(s, f))
2338 : #elif PY_MAJOR_VERSION < 3
2339 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2340 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2341 : likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
2342 : PyObject_Format(s, f))
2343 : #elif CYTHON_USE_TYPE_SLOTS
2344 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2345 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2346 : likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2347 : likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2348 : PyObject_Format(s, f))
2349 : #else
2350 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2351 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2352 : PyObject_Format(s, f))
2353 : #endif
2354 :
2355 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2356 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2357 : /* GetAttr.proto */
2358 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2359 :
2360 : /* GetItemInt.proto */
2361 : #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2362 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2363 : __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2364 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2365 : __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2366 : #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2367 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2368 : __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2369 : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2370 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2371 : int wraparound, int boundscheck);
2372 : #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2373 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2374 : __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2375 : (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2376 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2377 : int wraparound, int boundscheck);
2378 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2379 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2380 : int is_list, int wraparound, int boundscheck);
2381 :
2382 : /* PyObjectCallOneArg.proto */
2383 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2384 :
2385 : /* ObjectGetItem.proto */
2386 : #if CYTHON_USE_TYPE_SLOTS
2387 : static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2388 : #else
2389 : #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2390 : #endif
2391 :
2392 : /* KeywordStringCheck.proto */
2393 : static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);
2394 :
2395 : /* DivInt[Py_ssize_t].proto */
2396 : static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2397 :
2398 : /* UnaryNegOverflows.proto */
2399 : #define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
2400 : (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2401 :
2402 : /* GetAttr3.proto */
2403 : static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2404 :
2405 : /* PyDictVersioning.proto */
2406 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2407 : #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2408 : #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2409 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2410 : (version_var) = __PYX_GET_DICT_VERSION(dict);\
2411 : (cache_var) = (value);
2412 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2413 : static PY_UINT64_T __pyx_dict_version = 0;\
2414 : static PyObject *__pyx_dict_cached_value = NULL;\
2415 : if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2416 : (VAR) = __pyx_dict_cached_value;\
2417 : } else {\
2418 : (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2419 : __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2420 : }\
2421 : }
2422 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2423 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2424 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2425 : #else
2426 : #define __PYX_GET_DICT_VERSION(dict) (0)
2427 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2428 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2429 : #endif
2430 :
2431 : /* GetModuleGlobalName.proto */
2432 : #if CYTHON_USE_DICT_VERSIONS
2433 : #define __Pyx_GetModuleGlobalName(var, name) do {\
2434 : static PY_UINT64_T __pyx_dict_version = 0;\
2435 : static PyObject *__pyx_dict_cached_value = NULL;\
2436 : (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
2437 : (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2438 : __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2439 : } while(0)
2440 : #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2441 : PY_UINT64_T __pyx_dict_version;\
2442 : PyObject *__pyx_dict_cached_value;\
2443 : (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2444 : } while(0)
2445 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2446 : #else
2447 : #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2448 : #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2449 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2450 : #endif
2451 :
2452 : /* AssertionsEnabled.proto */
2453 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2454 : #define __Pyx_init_assertions_enabled() (0)
2455 : #define __pyx_assertions_enabled() (1)
2456 : #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000)
2457 : static int __pyx_assertions_enabled_flag;
2458 : #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2459 1 : static int __Pyx_init_assertions_enabled(void) {
2460 1 : PyObject *builtins, *debug, *debug_str;
2461 1 : int flag;
2462 1 : builtins = PyEval_GetBuiltins();
2463 1 : if (!builtins) goto bad;
2464 1 : debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
2465 1 : if (!debug_str) goto bad;
2466 1 : debug = PyObject_GetItem(builtins, debug_str);
2467 1 : Py_DECREF(debug_str);
2468 1 : if (!debug) goto bad;
2469 1 : flag = PyObject_IsTrue(debug);
2470 1 : Py_DECREF(debug);
2471 1 : if (flag == -1) goto bad;
2472 1 : __pyx_assertions_enabled_flag = flag;
2473 1 : return 0;
2474 0 : bad:
2475 0 : __pyx_assertions_enabled_flag = 1;
2476 0 : return -1;
2477 : }
2478 : #else
2479 : #define __Pyx_init_assertions_enabled() (0)
2480 : #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2481 : #endif
2482 :
2483 : /* RaiseTooManyValuesToUnpack.proto */
2484 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2485 :
2486 : /* RaiseNeedMoreValuesToUnpack.proto */
2487 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2488 :
2489 : /* RaiseNoneIterError.proto */
2490 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2491 :
2492 : /* ExtTypeTest.proto */
2493 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2494 :
2495 : /* GetTopmostException.proto */
2496 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2497 : static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2498 : #endif
2499 :
2500 : /* SaveResetException.proto */
2501 : #if CYTHON_FAST_THREAD_STATE
2502 : #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2503 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2504 : #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2505 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2506 : #else
2507 : #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2508 : #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2509 : #endif
2510 :
2511 : /* GetException.proto */
2512 : #if CYTHON_FAST_THREAD_STATE
2513 : #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2514 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2515 : #else
2516 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2517 : #endif
2518 :
2519 : /* SwapException.proto */
2520 : #if CYTHON_FAST_THREAD_STATE
2521 : #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2522 : static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2523 : #else
2524 : static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2525 : #endif
2526 :
2527 : /* Import.proto */
2528 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2529 :
2530 : /* ImportDottedModule.proto */
2531 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
2532 : #if PY_MAJOR_VERSION >= 3
2533 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
2534 : #endif
2535 :
2536 : /* FastTypeChecks.proto */
2537 : #if CYTHON_COMPILING_IN_CPYTHON
2538 : #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2539 : #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2540 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2541 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2542 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2543 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2544 : #else
2545 : #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2546 : #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2547 : #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2548 : #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2549 : #endif
2550 : #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2551 : #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2552 :
2553 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2554 : /* ListCompAppend.proto */
2555 : #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2556 0 : static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2557 0 : PyListObject* L = (PyListObject*) list;
2558 0 : Py_ssize_t len = Py_SIZE(list);
2559 0 : if (likely(L->allocated > len)) {
2560 0 : Py_INCREF(x);
2561 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2562 : L->ob_item[len] = x;
2563 : #else
2564 0 : PyList_SET_ITEM(list, len, x);
2565 : #endif
2566 0 : __Pyx_SET_SIZE(list, len + 1);
2567 0 : return 0;
2568 : }
2569 0 : return PyList_Append(list, x);
2570 : }
2571 : #else
2572 : #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2573 : #endif
2574 :
2575 : /* PySequenceMultiply.proto */
2576 : #define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
2577 : static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
2578 :
2579 : /* SetItemInt.proto */
2580 : #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2581 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2582 : __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
2583 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
2584 : __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
2585 : static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2586 : static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2587 : int is_list, int wraparound, int boundscheck);
2588 :
2589 : /* RaiseUnboundLocalError.proto */
2590 : static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2591 :
2592 : /* DivInt[long].proto */
2593 : static CYTHON_INLINE long __Pyx_div_long(long, long);
2594 :
2595 : /* PySequenceContains.proto */
2596 0 : static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2597 0 : int result = PySequence_Contains(seq, item);
2598 0 : return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2599 : }
2600 :
2601 : /* ImportFrom.proto */
2602 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2603 :
2604 : /* HasAttr.proto */
2605 : static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2606 :
2607 : /* IterFinish.proto */
2608 : static CYTHON_INLINE int __Pyx_IterFinish(void);
2609 :
2610 : /* UnpackItemEndCheck.proto */
2611 : static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
2612 :
2613 : /* PyObjectFormatAndDecref.proto */
2614 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
2615 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
2616 :
2617 : /* PyIntCompare.proto */
2618 : static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
2619 :
2620 : /* PyObject_GenericGetAttrNoDict.proto */
2621 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2622 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2623 : #else
2624 : #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2625 : #endif
2626 :
2627 : /* PyObject_GenericGetAttr.proto */
2628 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2629 : static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2630 : #else
2631 : #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2632 : #endif
2633 :
2634 : /* IncludeStructmemberH.proto */
2635 : #include <structmember.h>
2636 :
2637 : /* FixUpExtensionType.proto */
2638 : #if CYTHON_USE_TYPE_SPECS
2639 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
2640 : #endif
2641 :
2642 : /* PyObjectCallNoArg.proto */
2643 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2644 :
2645 : /* PyObjectGetMethod.proto */
2646 : static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2647 :
2648 : /* PyObjectCallMethod0.proto */
2649 : static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
2650 :
2651 : /* ValidateBasesTuple.proto */
2652 : #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
2653 : static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
2654 : #endif
2655 :
2656 : /* PyType_Ready.proto */
2657 : CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
2658 :
2659 : /* SetVTable.proto */
2660 : static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
2661 :
2662 : /* GetVTable.proto */
2663 : static void* __Pyx_GetVtable(PyTypeObject *type);
2664 :
2665 : /* MergeVTables.proto */
2666 : #if !CYTHON_COMPILING_IN_LIMITED_API
2667 : static int __Pyx_MergeVtables(PyTypeObject *type);
2668 : #endif
2669 :
2670 : /* SetupReduce.proto */
2671 : #if !CYTHON_COMPILING_IN_LIMITED_API
2672 : static int __Pyx_setup_reduce(PyObject* type_obj);
2673 : #endif
2674 :
2675 : /* TypeImport.proto */
2676 : #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11
2677 : #define __PYX_HAVE_RT_ImportType_proto_3_0_11
2678 : #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2679 : #include <stdalign.h>
2680 : #endif
2681 : #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2682 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s)
2683 : #else
2684 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*)
2685 : #endif
2686 : enum __Pyx_ImportType_CheckSize_3_0_11 {
2687 : __Pyx_ImportType_CheckSize_Error_3_0_11 = 0,
2688 : __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1,
2689 : __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2
2690 : };
2691 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size);
2692 : #endif
2693 :
2694 : /* FetchSharedCythonModule.proto */
2695 : static PyObject *__Pyx_FetchSharedCythonABIModule(void);
2696 :
2697 : /* FetchCommonType.proto */
2698 : #if !CYTHON_USE_TYPE_SPECS
2699 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2700 : #else
2701 : static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
2702 : #endif
2703 :
2704 : /* PyMethodNew.proto */
2705 : #if CYTHON_COMPILING_IN_LIMITED_API
2706 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2707 : PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
2708 : CYTHON_UNUSED_VAR(typ);
2709 : if (!self)
2710 : return __Pyx_NewRef(func);
2711 : typesModule = PyImport_ImportModule("types");
2712 : if (!typesModule) return NULL;
2713 : methodType = PyObject_GetAttrString(typesModule, "MethodType");
2714 : Py_DECREF(typesModule);
2715 : if (!methodType) return NULL;
2716 : result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
2717 : Py_DECREF(methodType);
2718 : return result;
2719 : }
2720 : #elif PY_MAJOR_VERSION >= 3
2721 0 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2722 0 : CYTHON_UNUSED_VAR(typ);
2723 0 : if (!self)
2724 0 : return __Pyx_NewRef(func);
2725 0 : return PyMethod_New(func, self);
2726 : }
2727 : #else
2728 : #define __Pyx_PyMethod_New PyMethod_New
2729 : #endif
2730 :
2731 : /* PyVectorcallFastCallDict.proto */
2732 : #if CYTHON_METH_FASTCALL
2733 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
2734 : #endif
2735 :
2736 : /* CythonFunctionShared.proto */
2737 : #define __Pyx_CyFunction_USED
2738 : #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2739 : #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2740 : #define __Pyx_CYFUNCTION_CCLASS 0x04
2741 : #define __Pyx_CYFUNCTION_COROUTINE 0x08
2742 : #define __Pyx_CyFunction_GetClosure(f)\
2743 : (((__pyx_CyFunctionObject *) (f))->func_closure)
2744 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2745 : #define __Pyx_CyFunction_GetClassObj(f)\
2746 : (((__pyx_CyFunctionObject *) (f))->func_classobj)
2747 : #else
2748 : #define __Pyx_CyFunction_GetClassObj(f)\
2749 : ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2750 : #endif
2751 : #define __Pyx_CyFunction_SetClassObj(f, classobj)\
2752 : __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
2753 : #define __Pyx_CyFunction_Defaults(type, f)\
2754 : ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2755 : #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2756 : ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2757 : typedef struct {
2758 : #if CYTHON_COMPILING_IN_LIMITED_API
2759 : PyObject_HEAD
2760 : PyObject *func;
2761 : #elif PY_VERSION_HEX < 0x030900B1
2762 : PyCFunctionObject func;
2763 : #else
2764 : PyCMethodObject func;
2765 : #endif
2766 : #if CYTHON_BACKPORT_VECTORCALL
2767 : __pyx_vectorcallfunc func_vectorcall;
2768 : #endif
2769 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
2770 : PyObject *func_weakreflist;
2771 : #endif
2772 : PyObject *func_dict;
2773 : PyObject *func_name;
2774 : PyObject *func_qualname;
2775 : PyObject *func_doc;
2776 : PyObject *func_globals;
2777 : PyObject *func_code;
2778 : PyObject *func_closure;
2779 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2780 : PyObject *func_classobj;
2781 : #endif
2782 : void *defaults;
2783 : int defaults_pyobjects;
2784 : size_t defaults_size;
2785 : int flags;
2786 : PyObject *defaults_tuple;
2787 : PyObject *defaults_kwdict;
2788 : PyObject *(*defaults_getter)(PyObject *);
2789 : PyObject *func_annotations;
2790 : PyObject *func_is_coroutine;
2791 : } __pyx_CyFunctionObject;
2792 : #undef __Pyx_CyOrPyCFunction_Check
2793 : #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
2794 : #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
2795 : #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
2796 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
2797 : #undef __Pyx_IsSameCFunction
2798 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
2799 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2800 : int flags, PyObject* qualname,
2801 : PyObject *closure,
2802 : PyObject *module, PyObject *globals,
2803 : PyObject* code);
2804 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
2805 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2806 : size_t size,
2807 : int pyobjects);
2808 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2809 : PyObject *tuple);
2810 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2811 : PyObject *dict);
2812 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2813 : PyObject *dict);
2814 : static int __pyx_CyFunction_init(PyObject *module);
2815 : #if CYTHON_METH_FASTCALL
2816 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2817 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2818 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2819 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2820 : #if CYTHON_BACKPORT_VECTORCALL
2821 : #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
2822 : #else
2823 : #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
2824 : #endif
2825 : #endif
2826 :
2827 : /* CythonFunction.proto */
2828 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2829 : int flags, PyObject* qualname,
2830 : PyObject *closure,
2831 : PyObject *module, PyObject *globals,
2832 : PyObject* code);
2833 :
2834 : /* CLineInTraceback.proto */
2835 : #ifdef CYTHON_CLINE_IN_TRACEBACK
2836 : #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2837 : #else
2838 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2839 : #endif
2840 :
2841 : /* CodeObjectCache.proto */
2842 : #if !CYTHON_COMPILING_IN_LIMITED_API
2843 : typedef struct {
2844 : PyCodeObject* code_object;
2845 : int code_line;
2846 : } __Pyx_CodeObjectCacheEntry;
2847 : struct __Pyx_CodeObjectCache {
2848 : int count;
2849 : int max_count;
2850 : __Pyx_CodeObjectCacheEntry* entries;
2851 : };
2852 : static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2853 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2854 : static PyCodeObject *__pyx_find_code_object(int code_line);
2855 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2856 : #endif
2857 :
2858 : /* AddTraceback.proto */
2859 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
2860 : int py_line, const char *filename);
2861 :
2862 : #if PY_MAJOR_VERSION < 3
2863 : static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2864 : static void __Pyx_ReleaseBuffer(Py_buffer *view);
2865 : #else
2866 : #define __Pyx_GetBuffer PyObject_GetBuffer
2867 : #define __Pyx_ReleaseBuffer PyBuffer_Release
2868 : #endif
2869 :
2870 :
2871 : /* BufferStructDeclare.proto */
2872 : typedef struct {
2873 : Py_ssize_t shape, strides, suboffsets;
2874 : } __Pyx_Buf_DimInfo;
2875 : typedef struct {
2876 : size_t refcount;
2877 : Py_buffer pybuffer;
2878 : } __Pyx_Buffer;
2879 : typedef struct {
2880 : __Pyx_Buffer *rcbuffer;
2881 : char *data;
2882 : __Pyx_Buf_DimInfo diminfo[8];
2883 : } __Pyx_LocalBuf_ND;
2884 :
2885 : /* MemviewSliceIsContig.proto */
2886 : static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2887 :
2888 : /* OverlappingSlices.proto */
2889 : static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2890 : __Pyx_memviewslice *slice2,
2891 : int ndim, size_t itemsize);
2892 :
2893 : /* IsLittleEndian.proto */
2894 : static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2895 :
2896 : /* BufferFormatCheck.proto */
2897 : static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2898 : static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2899 : __Pyx_BufFmt_StackElem* stack,
2900 : __Pyx_TypeInfo* type);
2901 :
2902 : /* TypeInfoCompare.proto */
2903 : static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2904 :
2905 : /* MemviewSliceValidateAndInit.proto */
2906 : static int __Pyx_ValidateAndInit_memviewslice(
2907 : int *axes_specs,
2908 : int c_or_f_flag,
2909 : int buf_flags,
2910 : int ndim,
2911 : __Pyx_TypeInfo *dtype,
2912 : __Pyx_BufFmt_StackElem stack[],
2913 : __Pyx_memviewslice *memviewslice,
2914 : PyObject *original_obj);
2915 :
2916 : /* ObjectToMemviewSlice.proto */
2917 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t__const__(PyObject *, int writable_flag);
2918 :
2919 : /* ObjectToMemviewSlice.proto */
2920 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(PyObject *, int writable_flag);
2921 :
2922 : /* MemviewDtypeToObject.proto */
2923 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(const char *itemp);
2924 : static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(const char *itemp, PyObject *obj);
2925 :
2926 : /* ObjectToMemviewSlice.proto */
2927 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t(PyObject *, int writable_flag);
2928 :
2929 : /* ObjectToMemviewSlice.proto */
2930 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t(PyObject *, int writable_flag);
2931 :
2932 : /* RealImag.proto */
2933 : #if CYTHON_CCOMPLEX
2934 : #ifdef __cplusplus
2935 : #define __Pyx_CREAL(z) ((z).real())
2936 : #define __Pyx_CIMAG(z) ((z).imag())
2937 : #else
2938 : #define __Pyx_CREAL(z) (__real__(z))
2939 : #define __Pyx_CIMAG(z) (__imag__(z))
2940 : #endif
2941 : #else
2942 : #define __Pyx_CREAL(z) ((z).real)
2943 : #define __Pyx_CIMAG(z) ((z).imag)
2944 : #endif
2945 : #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2946 : && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2947 : #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2948 : #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2949 : #else
2950 : #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2951 : #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2952 : #endif
2953 :
2954 : /* Arithmetic.proto */
2955 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2956 : #define __Pyx_c_eq_float(a, b) ((a)==(b))
2957 : #define __Pyx_c_sum_float(a, b) ((a)+(b))
2958 : #define __Pyx_c_diff_float(a, b) ((a)-(b))
2959 : #define __Pyx_c_prod_float(a, b) ((a)*(b))
2960 : #define __Pyx_c_quot_float(a, b) ((a)/(b))
2961 : #define __Pyx_c_neg_float(a) (-(a))
2962 : #ifdef __cplusplus
2963 : #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2964 : #define __Pyx_c_conj_float(z) (::std::conj(z))
2965 : #if 1
2966 : #define __Pyx_c_abs_float(z) (::std::abs(z))
2967 : #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2968 : #endif
2969 : #else
2970 : #define __Pyx_c_is_zero_float(z) ((z)==0)
2971 : #define __Pyx_c_conj_float(z) (conjf(z))
2972 : #if 1
2973 : #define __Pyx_c_abs_float(z) (cabsf(z))
2974 : #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2975 : #endif
2976 : #endif
2977 : #else
2978 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2979 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2980 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2981 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2982 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2983 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2984 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2985 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2986 : #if 1
2987 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2988 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2989 : #endif
2990 : #endif
2991 :
2992 : /* Arithmetic.proto */
2993 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2994 : #define __Pyx_c_eq_double(a, b) ((a)==(b))
2995 : #define __Pyx_c_sum_double(a, b) ((a)+(b))
2996 : #define __Pyx_c_diff_double(a, b) ((a)-(b))
2997 : #define __Pyx_c_prod_double(a, b) ((a)*(b))
2998 : #define __Pyx_c_quot_double(a, b) ((a)/(b))
2999 : #define __Pyx_c_neg_double(a) (-(a))
3000 : #ifdef __cplusplus
3001 : #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3002 : #define __Pyx_c_conj_double(z) (::std::conj(z))
3003 : #if 1
3004 : #define __Pyx_c_abs_double(z) (::std::abs(z))
3005 : #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3006 : #endif
3007 : #else
3008 : #define __Pyx_c_is_zero_double(z) ((z)==0)
3009 : #define __Pyx_c_conj_double(z) (conj(z))
3010 : #if 1
3011 : #define __Pyx_c_abs_double(z) (cabs(z))
3012 : #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3013 : #endif
3014 : #endif
3015 : #else
3016 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3017 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3018 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3019 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3020 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3021 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3022 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3023 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3024 : #if 1
3025 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3026 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3027 : #endif
3028 : #endif
3029 :
3030 : /* Arithmetic.proto */
3031 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3032 : #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3033 : #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3034 : #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3035 : #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3036 : #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3037 : #define __Pyx_c_neg_long__double(a) (-(a))
3038 : #ifdef __cplusplus
3039 : #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3040 : #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3041 : #if 1
3042 : #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3043 : #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3044 : #endif
3045 : #else
3046 : #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3047 : #define __Pyx_c_conj_long__double(z) (conjl(z))
3048 : #if 1
3049 : #define __Pyx_c_abs_long__double(z) (cabsl(z))
3050 : #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3051 : #endif
3052 : #endif
3053 : #else
3054 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3055 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3056 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3057 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3058 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3059 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3060 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3061 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3062 : #if 1
3063 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3064 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3065 : #endif
3066 : #endif
3067 :
3068 : /* MemviewSliceCopyTemplate.proto */
3069 : static __Pyx_memviewslice
3070 : __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3071 : const char *mode, int ndim,
3072 : size_t sizeof_dtype, int contig_flag,
3073 : int dtype_is_object);
3074 :
3075 : /* MemviewSliceInit.proto */
3076 : #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
3077 : #define __Pyx_MEMVIEW_DIRECT 1
3078 : #define __Pyx_MEMVIEW_PTR 2
3079 : #define __Pyx_MEMVIEW_FULL 4
3080 : #define __Pyx_MEMVIEW_CONTIG 8
3081 : #define __Pyx_MEMVIEW_STRIDED 16
3082 : #define __Pyx_MEMVIEW_FOLLOW 32
3083 : #define __Pyx_IS_C_CONTIG 1
3084 : #define __Pyx_IS_F_CONTIG 2
3085 : static int __Pyx_init_memviewslice(
3086 : struct __pyx_memoryview_obj *memview,
3087 : int ndim,
3088 : __Pyx_memviewslice *memviewslice,
3089 : int memview_is_new_reference);
3090 : static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3091 : __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3092 : static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3093 : __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3094 : #define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3095 : #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3096 : #define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3097 : static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3098 : static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);
3099 :
3100 : /* CIntFromPy.proto */
3101 : static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
3102 :
3103 : /* CIntToPy.proto */
3104 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
3105 :
3106 : /* CIntToPy.proto */
3107 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
3108 :
3109 : /* CIntFromPy.proto */
3110 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
3111 :
3112 : /* CIntFromPy.proto */
3113 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3114 :
3115 : /* CIntToPy.proto */
3116 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
3117 :
3118 : /* CIntFromPy.proto */
3119 : static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
3120 :
3121 : /* FormatTypeName.proto */
3122 : #if CYTHON_COMPILING_IN_LIMITED_API
3123 : typedef PyObject *__Pyx_TypeName;
3124 : #define __Pyx_FMT_TYPENAME "%U"
3125 : static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
3126 : #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
3127 : #else
3128 : typedef const char *__Pyx_TypeName;
3129 : #define __Pyx_FMT_TYPENAME "%.200s"
3130 : #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
3131 : #define __Pyx_DECREF_TypeName(obj)
3132 : #endif
3133 :
3134 : /* CheckBinaryVersion.proto */
3135 : static unsigned long __Pyx_get_runtime_version(void);
3136 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3137 :
3138 : /* InitStrings.proto */
3139 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
3140 :
3141 : /* #### Code section: module_declarations ### */
3142 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3143 : static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3144 : static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3145 : static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3146 : static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
3147 : static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3148 : static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3149 : static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3150 : static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
3151 : static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3152 : static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3153 : static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
3154 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self); /* proto*/
3155 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self); /* proto*/
3156 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self); /* proto*/
3157 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self); /* proto*/
3158 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self); /* proto*/
3159 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self); /* proto*/
3160 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3161 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3162 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3163 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3164 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3165 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3166 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/
3167 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/
3168 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/
3169 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/
3170 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/
3171 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
3172 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
3173 :
3174 : /* Module declarations from "cython.view" */
3175 :
3176 : /* Module declarations from "cython.dataclasses" */
3177 :
3178 : /* Module declarations from "cython" */
3179 :
3180 : /* Module declarations from "libc.string" */
3181 :
3182 : /* Module declarations from "libc.stdio" */
3183 :
3184 : /* Module declarations from "__builtin__" */
3185 :
3186 : /* Module declarations from "cpython.type" */
3187 :
3188 : /* Module declarations from "cpython" */
3189 :
3190 : /* Module declarations from "cpython.object" */
3191 :
3192 : /* Module declarations from "cpython.ref" */
3193 :
3194 : /* Module declarations from "numpy" */
3195 :
3196 : /* Module declarations from "numpy" */
3197 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/
3198 :
3199 : /* Module declarations from "libc.math" */
3200 :
3201 : /* Module declarations from "scipy.sparse.csgraph._matching" */
3202 : static PyObject *__pyx_collections_abc_Sequence = 0;
3203 : static PyObject *generic = 0;
3204 : static PyObject *strided = 0;
3205 : static PyObject *indirect = 0;
3206 : static PyObject *contiguous = 0;
3207 : static PyObject *indirect_contiguous = 0;
3208 : static int __pyx_memoryview_thread_locks_used;
3209 : static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3210 : static PyObject *__pyx_f_5scipy_6sparse_7csgraph_9_matching__hopcroft_karp(__Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const , __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const ); /*proto*/
3211 : static __Pyx_memviewslice __pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const , __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const ); /*proto*/
3212 : static __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp_single_l(__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t); /*proto*/
3213 : static PyObject *__pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp_update_dual(__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t, __pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t); /*proto*/
3214 : static PyObject *__pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp_update_assignments(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t); /*proto*/
3215 : static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
3216 : static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
3217 : static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
3218 : static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
3219 : static PyObject *_unellipsify(PyObject *, int); /*proto*/
3220 : static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
3221 : static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
3222 : static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
3223 : static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
3224 : static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
3225 : static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
3226 : static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3227 : static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3228 : static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
3229 : static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3230 : static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
3231 : static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
3232 : static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
3233 : static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
3234 : static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
3235 : static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
3236 : static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
3237 : static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
3238 : static int __pyx_memoryview_err_dim(PyObject *, PyObject *, int); /*proto*/
3239 : static int __pyx_memoryview_err(PyObject *, PyObject *); /*proto*/
3240 : static int __pyx_memoryview_err_no_memory(void); /*proto*/
3241 : static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
3242 : static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
3243 : static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
3244 : static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3245 : static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3246 : static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
3247 : static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
3248 : static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
3249 : /* #### Code section: typeinfo ### */
3250 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t__const__ = { "const ITYPE_t", NULL, sizeof(__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const ), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const ) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const ), 0 };
3251 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t = { "ITYPE_t", NULL, sizeof(__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t), 0 };
3252 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t = { "DTYPE_t", NULL, sizeof(__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t), { 0 }, 0, 'R', 0, 0 };
3253 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t = { "BTYPE_t", NULL, sizeof(__pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t), 0 };
3254 : /* #### Code section: before_global_var ### */
3255 : #define __Pyx_MODULE_NAME "scipy.sparse.csgraph._matching"
3256 : extern int __pyx_module_is_main_scipy__sparse__csgraph___matching;
3257 : int __pyx_module_is_main_scipy__sparse__csgraph___matching = 0;
3258 :
3259 : /* Implementation of "scipy.sparse.csgraph._matching" */
3260 : /* #### Code section: global_var ### */
3261 : static PyObject *__pyx_builtin_TypeError;
3262 : static PyObject *__pyx_builtin_range;
3263 : static PyObject *__pyx_builtin_ValueError;
3264 : static PyObject *__pyx_builtin___import__;
3265 : static PyObject *__pyx_builtin_MemoryError;
3266 : static PyObject *__pyx_builtin_enumerate;
3267 : static PyObject *__pyx_builtin_AssertionError;
3268 : static PyObject *__pyx_builtin_Ellipsis;
3269 : static PyObject *__pyx_builtin_id;
3270 : static PyObject *__pyx_builtin_IndexError;
3271 : static PyObject *__pyx_builtin_ImportError;
3272 : /* #### Code section: string_decls ### */
3273 : static const char __pyx_k_[] = ": ";
3274 : static const char __pyx_k_O[] = "O";
3275 : static const char __pyx_k_T[] = "T";
3276 : static const char __pyx_k_a[] = "a";
3277 : static const char __pyx_k_b[] = "b";
3278 : static const char __pyx_k_c[] = "c";
3279 : static const char __pyx_k_i[] = "i";
3280 : static const char __pyx_k_j[] = "j";
3281 : static const char __pyx_k_x[] = "x";
3282 : static const char __pyx_k_y[] = "y";
3283 : static const char __pyx_k__2[] = ".";
3284 : static const char __pyx_k__3[] = "*";
3285 : static const char __pyx_k__6[] = "'";
3286 : static const char __pyx_k__7[] = ")";
3287 : static const char __pyx_k_gc[] = "gc";
3288 : static const char __pyx_k_id[] = "id";
3289 : static const char __pyx_k_np[] = "np";
3290 : static const char __pyx_k__28[] = "_";
3291 : static const char __pyx_k__32[] = "?";
3292 : static const char __pyx_k_abc[] = "abc";
3293 : static const char __pyx_k_all[] = "all";
3294 : static const char __pyx_k_and[] = " and ";
3295 : static const char __pyx_k_coo[] = "coo";
3296 : static const char __pyx_k_csc[] = "csc";
3297 : static const char __pyx_k_csr[] = "csr";
3298 : static const char __pyx_k_got[] = " (got ";
3299 : static const char __pyx_k_max[] = "max";
3300 : static const char __pyx_k_min[] = "min";
3301 : static const char __pyx_k_new[] = "__new__";
3302 : static const char __pyx_k_obj[] = "obj";
3303 : static const char __pyx_k_row[] = "row";
3304 : static const char __pyx_k_sum[] = "sum";
3305 : static const char __pyx_k_sys[] = "sys";
3306 : static const char __pyx_k_base[] = "base";
3307 : static const char __pyx_k_bool[] = "bool_";
3308 : static const char __pyx_k_data[] = "data";
3309 : static const char __pyx_k_dict[] = "__dict__";
3310 : static const char __pyx_k_main[] = "__main__";
3311 : static const char __pyx_k_mode[] = "mode";
3312 : static const char __pyx_k_name[] = "name";
3313 : static const char __pyx_k_ndim[] = "ndim";
3314 : static const char __pyx_k_pack[] = "pack";
3315 : static const char __pyx_k_size[] = "size";
3316 : static const char __pyx_k_spec[] = "__spec__";
3317 : static const char __pyx_k_step[] = "step";
3318 : static const char __pyx_k_stop[] = "stop";
3319 : static const char __pyx_k_test[] = "__test__";
3320 : static const char __pyx_k_warn[] = "warn";
3321 : static const char __pyx_k_ASCII[] = "ASCII";
3322 : static const char __pyx_k_BTYPE[] = "BTYPE";
3323 : static const char __pyx_k_DTYPE[] = "DTYPE";
3324 : static const char __pyx_k_ITYPE[] = "ITYPE";
3325 : static const char __pyx_k_class[] = "__class__";
3326 : static const char __pyx_k_count[] = "count";
3327 : static const char __pyx_k_dtype[] = "dtype";
3328 : static const char __pyx_k_empty[] = "empty";
3329 : static const char __pyx_k_error[] = "error";
3330 : static const char __pyx_k_flags[] = "flags";
3331 : static const char __pyx_k_got_2[] = "got ";
3332 : static const char __pyx_k_graph[] = "graph";
3333 : static const char __pyx_k_iinfo[] = "iinfo";
3334 : static const char __pyx_k_index[] = "index";
3335 : static const char __pyx_k_int32[] = "int32";
3336 : static const char __pyx_k_numpy[] = "numpy";
3337 : static const char __pyx_k_range[] = "range";
3338 : static const char __pyx_k_shape[] = "shape";
3339 : static const char __pyx_k_start[] = "start";
3340 : static const char __pyx_k_tocsr[] = "tocsr";
3341 : static const char __pyx_k_uint8[] = "uint8";
3342 : static const char __pyx_k_zeros[] = "zeros";
3343 : static const char __pyx_k_arange[] = "arange";
3344 : static const char __pyx_k_astype[] = "astype";
3345 : static const char __pyx_k_column[] = "column";
3346 : static const char __pyx_k_double[] = "double";
3347 : static const char __pyx_k_enable[] = "enable";
3348 : static const char __pyx_k_encode[] = "encode";
3349 : static const char __pyx_k_format[] = "format";
3350 : static const char __pyx_k_import[] = "__import__";
3351 : static const char __pyx_k_indptr[] = "indptr";
3352 : static const char __pyx_k_name_2[] = "__name__";
3353 : static const char __pyx_k_pickle[] = "pickle";
3354 : static const char __pyx_k_reduce[] = "__reduce__";
3355 : static const char __pyx_k_struct[] = "struct";
3356 : static const char __pyx_k_unpack[] = "unpack";
3357 : static const char __pyx_k_update[] = "update";
3358 : static const char __pyx_k_argsort[] = "argsort";
3359 : static const char __pyx_k_asarray[] = "asarray";
3360 : static const char __pyx_k_disable[] = "disable";
3361 : static const char __pyx_k_float64[] = "float64";
3362 : static const char __pyx_k_fortran[] = "fortran";
3363 : static const char __pyx_k_indices[] = "indices";
3364 : static const char __pyx_k_memview[] = "memview";
3365 : static const char __pyx_k_Ellipsis[] = "Ellipsis";
3366 : static const char __pyx_k_Sequence[] = "Sequence";
3367 : static const char __pyx_k_getstate[] = "__getstate__";
3368 : static const char __pyx_k_isposinf[] = "isposinf";
3369 : static const char __pyx_k_issparse[] = "issparse";
3370 : static const char __pyx_k_itemsize[] = "itemsize";
3371 : static const char __pyx_k_matching[] = "matching";
3372 : static const char __pyx_k_maximize[] = "maximize";
3373 : static const char __pyx_k_pyx_type[] = "__pyx_type";
3374 : static const char __pyx_k_register[] = "register";
3375 : static const char __pyx_k_setstate[] = "__setstate__";
3376 : static const char __pyx_k_warnings[] = "warnings";
3377 : static const char __pyx_k_TypeError[] = "TypeError";
3378 : static const char __pyx_k_enumerate[] = "enumerate";
3379 : static const char __pyx_k_isenabled[] = "isenabled";
3380 : static const char __pyx_k_perm_type[] = "perm_type";
3381 : static const char __pyx_k_pyx_state[] = "__pyx_state";
3382 : static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
3383 : static const char __pyx_k_IndexError[] = "IndexError";
3384 : static const char __pyx_k_ValueError[] = "ValueError";
3385 : static const char __pyx_k_issubdtype[] = "issubdtype";
3386 : static const char __pyx_k_pyx_result[] = "__pyx_result";
3387 : static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
3388 : static const char __pyx_k_ImportError[] = "ImportError";
3389 : static const char __pyx_k_MemoryError[] = "MemoryError";
3390 : static const char __pyx_k_PickleError[] = "PickleError";
3391 : static const char __pyx_k_collections[] = "collections";
3392 : static const char __pyx_k_initializing[] = "_initializing";
3393 : static const char __pyx_k_is_coroutine[] = "_is_coroutine";
3394 : static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
3395 : static const char __pyx_k_scipy_sparse[] = "scipy.sparse";
3396 : static const char __pyx_k_stringsource[] = "<stringsource>";
3397 : static const char __pyx_k_version_info[] = "version_info";
3398 : static const char __pyx_k_class_getitem[] = "__class_getitem__";
3399 : static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
3400 : static const char __pyx_k_AssertionError[] = "AssertionError";
3401 : static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
3402 : static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
3403 : static const char __pyx_k_collections_abc[] = "collections.abc";
3404 : static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
3405 : static const char __pyx_k_eliminate_zeros[] = "eliminate_zeros";
3406 : static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
3407 : static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
3408 : static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
3409 : static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
3410 : static const char __pyx_k_biadjacency_matrix[] = "biadjacency_matrix";
3411 : static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
3412 : static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
3413 : static const char __pyx_k_biadjacency_matrix_t[] = "biadjacency_matrix_t";
3414 : static const char __pyx_k_graph_must_be_sparse[] = "graph must be sparse";
3415 : static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
3416 : static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis ";
3417 : static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
3418 : static const char __pyx_k_scipy_sparse__sputils[] = "scipy.sparse._sputils";
3419 : static const char __pyx_k_Cannot_index_with_type[] = "Cannot index with type '";
3420 : static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
3421 : static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
3422 : static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
3423 : static const char __pyx_k_no_full_matching_exists[] = "no full matching exists";
3424 : static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
3425 : static const char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
3426 : static const char __pyx_k_maximum_bipartite_matching[] = "maximum_bipartite_matching";
3427 : static const char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
3428 : static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
3429 : static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
3430 : static const char __pyx_k_convert_pydata_sparse_to_scipy[] = "convert_pydata_sparse_to_scipy";
3431 : static const char __pyx_k_scipy_sparse_csgraph__matching[] = "scipy.sparse.csgraph._matching";
3432 : static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
3433 : static const char __pyx_k_graph_must_be_in_CSC_CSR_or_COO[] = "graph must be in CSC, CSR, or COO format.";
3434 : static const char __pyx_k_home_czgdp18079_Quansight_scipy[] = "/home/czgdp18079/Quansight/scipy/scipy/sparse/csgraph/_matching.pyx";
3435 : static const char __pyx_k_maximum_bipartite_matching_grap[] = "\n maximum_bipartite_matching(graph, perm_type='row')\n\n Returns a matching of a bipartite graph whose cardinality is as least that\n of any given matching of the graph.\n\n Parameters\n ----------\n graph : sparse matrix\n Input sparse in CSR format whose rows represent one partition of the\n graph and whose columns represent the other partition. An edge between\n two vertices is indicated by the corresponding entry in the matrix\n existing in its sparse representation.\n perm_type : str, {'row', 'column'}\n Which partition to return the matching in terms of: If ``'row'``, the\n function produces an array whose length is the number of columns in the\n input, and whose :math:`j`'th element is the row matched to the\n :math:`j`'th column. Conversely, if ``perm_type`` is ``'column'``, this\n returns the columns matched to each row.\n\n Returns\n -------\n perm : ndarray\n A matching of the vertices in one of the two partitions. Unmatched\n vertices are represented by a ``-1`` in the result.\n\n Notes\n -----\n This function implements the Hopcroft--Karp algorithm [1]_. Its time\n complexity is :math:`O(\\lvert E \\rvert \\sqrt{\\lvert V \\rvert})`, and its\n space complexity is linear in the number of rows. In practice, this\n asymmetry between rows and columns means that it can be more efficient to\n transpose the input if it contains more columns than rows.\n\n By Konig's theorem, the cardinality of the matching is also the number of\n vertices appearing in a minimum vertex cover of the graph.\n\n Note that if the sparse representation contains explicit zeros, these are\n still counted as edges.\n\n The implementation was changed in SciPy 1.4.0 to allow matching of general\n bipartite graphs, where previous versions would assume that a perfect\n matching existed. As such, code written against 1.4.0 will not necessarily""\n work on older versions.\n\n If multiple valid solutions are possible, output may vary with SciPy and\n Python version.\n\n References\n ----------\n .. [1] John E. Hopcroft and Richard M. Karp. \"An n^{5 / 2} Algorithm for\n Maximum Matchings in Bipartite Graphs\" In: SIAM Journal of Computing\n 2.4 (1973), pp. 225--231. :doi:`10.1137/0202019`\n\n Examples\n --------\n >>> from scipy.sparse import csr_matrix\n >>> from scipy.sparse.csgraph import maximum_bipartite_matching\n\n As a simple example, consider a bipartite graph in which the partitions\n contain 2 and 3 elements respectively. Suppose that one partition contains\n vertices labelled 0 and 1, and that the other partition contains vertices\n labelled A, B, and C. Suppose that there are edges connecting 0 and C,\n 1 and A, and 1 and B. This graph would then be represented by the following\n sparse matrix:\n\n >>> graph = csr_matrix([[0, 0, 1], [1, 1, 0]])\n\n Here, the 1s could be anything, as long as they end up being stored as\n elements in the sparse matrix. We can now calculate maximum matchings as\n follows:\n\n >>> print(maximum_bipartite_matching(graph, perm_type='column'))\n [2 0]\n >>> print(maximum_bipartite_matching(graph, perm_type='row'))\n [ 1 -1 0]\n\n The first output tells us that 1 and 2 are matched with C and A\n respectively, and the second output tells us that A, B, and C are matched\n with 1, nothing, and 0 respectively.\n\n Note that explicit zeros are still converted to edges. This means that a\n different way to represent the above graph is by using the CSR structure\n directly as follows:\n\n >>> data = [0, 0, 0]\n >>> indices = [2, 0, 1]\n >>> indptr = [0, 1, 3]\n >>> graph = csr_matrix((data, indices, indptr))\n >>> print(maximum_bipartite_matching(graph, perm_type='column'))\n [2 0]\n >>> print(maximum_bipartite_matching(graph, perm_type='row'))""\n [ 1 -1 0]\n\n When one or both of the partitions are empty, the matching is empty as\n well:\n\n >>> graph = csr_matrix((2, 0))\n >>> print(maximum_bipartite_matching(graph, perm_type='column'))\n [-1 -1]\n >>> print(maximum_bipartite_matching(graph, perm_type='row'))\n []\n\n When the input matrix is square, and the graph is known to admit a perfect\n matching, i.e. a matching with the property that every vertex in the graph\n belongs to some edge in the matching, then one can view the output as the\n permutation of rows (or columns) turning the input matrix into one with the\n property that all diagonal elements are non-empty:\n\n >>> a = [[0, 1, 2, 0], [1, 0, 0, 1], [2, 0, 0, 3], [0, 1, 3, 0]]\n >>> graph = csr_matrix(a)\n >>> perm = maximum_bipartite_matching(graph, perm_type='row')\n >>> print(graph[perm].toarray())\n [[1 0 0 1]\n [0 1 2 0]\n [0 1 3 0]\n [2 0 0 3]]\n\n ";
3436 : static const char __pyx_k_maximum_bipartite_matching_line[] = "maximum_bipartite_matching (line 17)";
3437 : static const char __pyx_k_min_weight_full_bipartite_match[] = "\n min_weight_full_bipartite_matching(biadjacency_matrix, maximize=False)\n\n Returns the minimum weight full matching of a bipartite graph.\n\n .. versionadded:: 1.6.0\n\n Parameters\n ----------\n biadjacency_matrix : sparse matrix\n Biadjacency matrix of the bipartite graph: A sparse matrix in CSR, CSC,\n or COO format whose rows represent one partition of the graph and whose\n columns represent the other partition. An edge between two vertices is\n indicated by the corresponding entry in the matrix, and the weight of\n the edge is given by the value of that entry. This should not be\n confused with the full adjacency matrix of the graph, as we only need\n the submatrix defining the bipartite structure.\n\n maximize : bool (default: False)\n Calculates a maximum weight matching if true.\n\n Returns\n -------\n row_ind, col_ind : array\n An array of row indices and one of corresponding column indices giving\n the optimal matching. The total weight of the matching can be computed\n as ``graph[row_ind, col_ind].sum()``. The row indices will be\n sorted; in the case of a square matrix they will be equal to\n ``numpy.arange(graph.shape[0])``.\n\n Notes\n -----\n\n Let :math:`G = ((U, V), E)` be a weighted bipartite graph with non-zero\n weights :math:`w : E \\to \\mathbb{R} \\setminus \\{0\\}`. This function then\n produces a matching :math:`M \\subseteq E` with cardinality\n\n .. math::\n \\lvert M \\rvert = \\min(\\lvert U \\rvert, \\lvert V \\rvert),\n\n which minimizes the sum of the weights of the edges included in the\n matching, :math:`\\sum_{e \\in M} w(e)`, or raises an error if no such\n matching exists.\n\n When :math:`\\lvert U \\rvert = \\lvert V \\rvert`, this is commonly\n referred to as a perfect matching; here, since we allow\n :math:`\\lvert U \\rvert` and :math:`\\lvert V \\rvert` to diffe""r, we\n follow Karp [1]_ and refer to the matching as *full*.\n\n This function implements the LAPJVsp algorithm [2]_, short for \"Linear\n assignment problem, Jonker--Volgenant, sparse\".\n\n The problem it solves is equivalent to the rectangular linear assignment\n problem. [3]_ As such, this function can be used to solve the same problems\n as :func:`scipy.optimize.linear_sum_assignment`. That function may perform\n better when the input is dense, or for certain particular types of inputs,\n such as those for which the :math:`(i, j)`'th entry is the distance between\n two points in Euclidean space.\n\n If no full matching exists, this function raises a ``ValueError``. For\n determining the size of the largest matching in the graph, see\n :func:`maximum_bipartite_matching`.\n\n We require that weights are non-zero only to avoid issues with the handling\n of explicit zeros when converting between different sparse representations.\n Zero weights can be handled by adding a constant to all weights, so that\n the resulting matrix contains no zeros.\n\n If multiple valid solutions are possible, output may vary with SciPy and\n Python version.\n\n References\n ----------\n .. [1] Richard Manning Karp:\n An algorithm to Solve the m x n Assignment Problem in Expected Time\n O(mn log n).\n Networks, 10(2):143-152, 1980.\n .. [2] Roy Jonker and Anton Volgenant:\n A Shortest Augmenting Path Algorithm for Dense and Sparse Linear\n Assignment Problems.\n Computing 38:325-340, 1987.\n .. [3] https://en.wikipedia.org/wiki/Assignment_problem\n\n Examples\n --------\n >>> from scipy.sparse import csr_matrix\n >>> from scipy.sparse.csgraph import min_weight_full_bipartite_matching\n\n Let us first consider an example in which all weights are equal:\n\n >>> biadjacency_matrix = csr_matrix([[1, 1, 1], [1, 0, 0], [0, 1, 0]])\n\n Here, all we get is a perfect mat""ching of the graph:\n\n >>> print(min_weight_full_bipartite_matching(biadjacency_matrix)[1])\n [2 0 1]\n\n That is, the first, second, and third rows are matched with the third,\n first, and second column respectively. Note that in this example, the 0\n in the input matrix does *not* correspond to an edge with weight 0, but\n rather a pair of vertices not paired by an edge.\n\n Note also that in this case, the output matches the result of applying\n :func:`maximum_bipartite_matching`:\n\n >>> from scipy.sparse.csgraph import maximum_bipartite_matching\n >>> biadjacency = csr_matrix([[1, 1, 1], [1, 0, 0], [0, 1, 0]])\n >>> print(maximum_bipartite_matching(biadjacency, perm_type='column'))\n [2 0 1]\n\n When multiple edges are available, the ones with lowest weights are\n preferred:\n\n >>> biadjacency = csr_matrix([[3, 3, 6], [4, 3, 5], [10, 1, 8]])\n >>> row_ind, col_ind = min_weight_full_bipartite_matching(biadjacency)\n >>> print(col_ind)\n [0 2 1]\n\n The total weight in this case is :math:`3 + 5 + 1 = 9`:\n\n >>> print(biadjacency[row_ind, col_ind].sum())\n 9\n\n When the matrix is not square, i.e. when the two partitions have different\n cardinalities, the matching is as large as the smaller of the two\n partitions:\n\n >>> biadjacency = csr_matrix([[0, 1, 1], [0, 2, 3]])\n >>> row_ind, col_ind = min_weight_full_bipartite_matching(biadjacency)\n >>> print(row_ind, col_ind)\n [0 1] [2 1]\n >>> biadjacency = csr_matrix([[0, 1], [3, 1], [1, 4]])\n >>> row_ind, col_ind = min_weight_full_bipartite_matching(biadjacency)\n >>> print(row_ind, col_ind)\n [0 2] [1 0]\n\n When one or both of the partitions are empty, the matching is empty as\n well:\n\n >>> biadjacency = csr_matrix((2, 0))\n >>> row_ind, col_ind = min_weight_full_bipartite_matching(biadjacency)\n >>> print(row_ind, col_ind)\n [] []\n\n In general, we will always reach the same sum of weight""s as if we had used\n :func:`scipy.optimize.linear_sum_assignment` but note that for that one,\n missing edges are represented by a matrix entry of ``float('inf')``. Let us\n generate a random sparse matrix with integer entries between 1 and 10:\n\n >>> import numpy as np\n >>> from scipy.sparse import random\n >>> from scipy.optimize import linear_sum_assignment\n >>> sparse = random(10, 10, random_state=42, density=.5, format='coo') * 10\n >>> sparse.data = np.ceil(sparse.data)\n >>> dense = sparse.toarray()\n >>> dense = np.full(sparse.shape, np.inf)\n >>> dense[sparse.row, sparse.col] = sparse.data\n >>> sparse = sparse.tocsr()\n >>> row_ind, col_ind = linear_sum_assignment(dense)\n >>> print(dense[row_ind, col_ind].sum())\n 28.0\n >>> row_ind, col_ind = min_weight_full_bipartite_matching(sparse)\n >>> print(sparse[row_ind, col_ind].sum())\n 28.0\n\n ";
3438 : static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
3439 : static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
3440 : static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
3441 : static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
3442 : static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
3443 : static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
3444 : static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
3445 : static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))";
3446 : static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
3447 : static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got ";
3448 : static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis ";
3449 : static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
3450 : static const char __pyx_k_expected_a_matrix_containing_num[] = "expected a matrix containing numerical entries, ";
3451 : static const char __pyx_k_explicit_zero_weights_are_remove[] = "explicit zero weights are removed before matching";
3452 : static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension ";
3453 : static const char __pyx_k_min_weight_full_bipartite_matchi[] = "min_weight_full_bipartite_matching";
3454 : static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
3455 : static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import";
3456 : static const char __pyx_k_numpy__core_umath_failed_to_impo[] = "numpy._core.umath failed to import";
3457 : static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
3458 : static const char __pyx_k_min_weight_full_bipartite_matchi_2[] = "min_weight_full_bipartite_matching (line 288)";
3459 : /* #### Code section: decls ### */
3460 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
3461 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3462 : static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3463 : static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3464 : static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3465 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3466 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3467 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
3468 : static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3469 : static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3470 : static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3471 : static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3472 : static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3473 : static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3474 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
3475 : static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3476 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3477 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
3478 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3479 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3480 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3481 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3482 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3483 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3484 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3485 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3486 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3487 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3488 : static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3489 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3490 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3491 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3492 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3493 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3494 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3495 : static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3496 : static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3497 : static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3498 : static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3499 : static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3500 : static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3501 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_9_matching_maximum_bipartite_matching(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_graph, PyObject *__pyx_v_perm_type); /* proto */
3502 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_9_matching_2min_weight_full_bipartite_matching(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_biadjacency_matrix, PyObject *__pyx_v_maximize); /* proto */
3503 : static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3504 : static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3505 : static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3506 : static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3507 : /* #### Code section: late_includes ### */
3508 : /* #### Code section: module_state ### */
3509 : typedef struct {
3510 : PyObject *__pyx_d;
3511 : PyObject *__pyx_b;
3512 : PyObject *__pyx_cython_runtime;
3513 : PyObject *__pyx_empty_tuple;
3514 : PyObject *__pyx_empty_bytes;
3515 : PyObject *__pyx_empty_unicode;
3516 : #ifdef __Pyx_CyFunction_USED
3517 : PyTypeObject *__pyx_CyFunctionType;
3518 : #endif
3519 : #ifdef __Pyx_FusedFunction_USED
3520 : PyTypeObject *__pyx_FusedFunctionType;
3521 : #endif
3522 : #ifdef __Pyx_Generator_USED
3523 : PyTypeObject *__pyx_GeneratorType;
3524 : #endif
3525 : #ifdef __Pyx_IterableCoroutine_USED
3526 : PyTypeObject *__pyx_IterableCoroutineType;
3527 : #endif
3528 : #ifdef __Pyx_Coroutine_USED
3529 : PyTypeObject *__pyx_CoroutineAwaitType;
3530 : #endif
3531 : #ifdef __Pyx_Coroutine_USED
3532 : PyTypeObject *__pyx_CoroutineType;
3533 : #endif
3534 : #if CYTHON_USE_MODULE_STATE
3535 : #endif
3536 : #if CYTHON_USE_MODULE_STATE
3537 : #endif
3538 : #if CYTHON_USE_MODULE_STATE
3539 : #endif
3540 : #if CYTHON_USE_MODULE_STATE
3541 : #endif
3542 : #if CYTHON_USE_MODULE_STATE
3543 : #endif
3544 : #if CYTHON_USE_MODULE_STATE
3545 : #endif
3546 : #if CYTHON_USE_MODULE_STATE
3547 : #endif
3548 : PyTypeObject *__pyx_ptype_7cpython_4type_type;
3549 : #if CYTHON_USE_MODULE_STATE
3550 : #endif
3551 : #if CYTHON_USE_MODULE_STATE
3552 : #endif
3553 : #if CYTHON_USE_MODULE_STATE
3554 : #endif
3555 : #if CYTHON_USE_MODULE_STATE
3556 : #endif
3557 : #if CYTHON_USE_MODULE_STATE
3558 : #endif
3559 : PyTypeObject *__pyx_ptype_5numpy_dtype;
3560 : PyTypeObject *__pyx_ptype_5numpy_flatiter;
3561 : PyTypeObject *__pyx_ptype_5numpy_broadcast;
3562 : PyTypeObject *__pyx_ptype_5numpy_ndarray;
3563 : PyTypeObject *__pyx_ptype_5numpy_generic;
3564 : PyTypeObject *__pyx_ptype_5numpy_number;
3565 : PyTypeObject *__pyx_ptype_5numpy_integer;
3566 : PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3567 : PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3568 : PyTypeObject *__pyx_ptype_5numpy_inexact;
3569 : PyTypeObject *__pyx_ptype_5numpy_floating;
3570 : PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3571 : PyTypeObject *__pyx_ptype_5numpy_flexible;
3572 : PyTypeObject *__pyx_ptype_5numpy_character;
3573 : PyTypeObject *__pyx_ptype_5numpy_ufunc;
3574 : #if CYTHON_USE_MODULE_STATE
3575 : #endif
3576 : #if CYTHON_USE_MODULE_STATE
3577 : PyObject *__pyx_type___pyx_array;
3578 : PyObject *__pyx_type___pyx_MemviewEnum;
3579 : PyObject *__pyx_type___pyx_memoryview;
3580 : PyObject *__pyx_type___pyx_memoryviewslice;
3581 : #endif
3582 : PyTypeObject *__pyx_array_type;
3583 : PyTypeObject *__pyx_MemviewEnum_type;
3584 : PyTypeObject *__pyx_memoryview_type;
3585 : PyTypeObject *__pyx_memoryviewslice_type;
3586 : PyObject *__pyx_kp_u_;
3587 : PyObject *__pyx_n_s_ASCII;
3588 : PyObject *__pyx_kp_s_All_dimensions_preceding_dimensi;
3589 : PyObject *__pyx_n_s_AssertionError;
3590 : PyObject *__pyx_n_s_BTYPE;
3591 : PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
3592 : PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
3593 : PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
3594 : PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
3595 : PyObject *__pyx_kp_u_Cannot_index_with_type;
3596 : PyObject *__pyx_kp_s_Cannot_transpose_memoryview_with;
3597 : PyObject *__pyx_n_s_DTYPE;
3598 : PyObject *__pyx_kp_s_Dimension_d_is_not_direct;
3599 : PyObject *__pyx_n_s_Ellipsis;
3600 : PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
3601 : PyObject *__pyx_n_s_ITYPE;
3602 : PyObject *__pyx_n_s_ImportError;
3603 : PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
3604 : PyObject *__pyx_n_s_IndexError;
3605 : PyObject *__pyx_kp_s_Index_out_of_bounds_axis_d;
3606 : PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
3607 : PyObject *__pyx_kp_u_Invalid_mode_expected_c_or_fortr;
3608 : PyObject *__pyx_kp_u_Invalid_shape_in_axis;
3609 : PyObject *__pyx_n_s_MemoryError;
3610 : PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
3611 : PyObject *__pyx_kp_s_MemoryView_of_r_object;
3612 : PyObject *__pyx_n_b_O;
3613 : PyObject *__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
3614 : PyObject *__pyx_n_s_PickleError;
3615 : PyObject *__pyx_n_s_Sequence;
3616 : PyObject *__pyx_kp_s_Step_may_not_be_zero_axis_d;
3617 : PyObject *__pyx_n_s_T;
3618 : PyObject *__pyx_n_s_TypeError;
3619 : PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
3620 : PyObject *__pyx_n_s_ValueError;
3621 : PyObject *__pyx_n_s_View_MemoryView;
3622 : PyObject *__pyx_kp_u__2;
3623 : PyObject *__pyx_n_s__28;
3624 : PyObject *__pyx_n_s__3;
3625 : PyObject *__pyx_n_s__32;
3626 : PyObject *__pyx_kp_u__6;
3627 : PyObject *__pyx_kp_u__7;
3628 : PyObject *__pyx_n_s_a;
3629 : PyObject *__pyx_n_s_abc;
3630 : PyObject *__pyx_n_s_all;
3631 : PyObject *__pyx_n_s_allocate_buffer;
3632 : PyObject *__pyx_kp_u_and;
3633 : PyObject *__pyx_n_s_arange;
3634 : PyObject *__pyx_n_s_argsort;
3635 : PyObject *__pyx_n_s_asarray;
3636 : PyObject *__pyx_n_s_astype;
3637 : PyObject *__pyx_n_s_asyncio_coroutines;
3638 : PyObject *__pyx_n_s_b;
3639 : PyObject *__pyx_n_s_base;
3640 : PyObject *__pyx_n_s_biadjacency_matrix;
3641 : PyObject *__pyx_n_s_biadjacency_matrix_t;
3642 : PyObject *__pyx_n_s_bool;
3643 : PyObject *__pyx_n_s_c;
3644 : PyObject *__pyx_n_u_c;
3645 : PyObject *__pyx_n_s_class;
3646 : PyObject *__pyx_n_s_class_getitem;
3647 : PyObject *__pyx_n_s_cline_in_traceback;
3648 : PyObject *__pyx_n_s_collections;
3649 : PyObject *__pyx_kp_s_collections_abc;
3650 : PyObject *__pyx_n_u_column;
3651 : PyObject *__pyx_kp_s_contiguous_and_direct;
3652 : PyObject *__pyx_kp_s_contiguous_and_indirect;
3653 : PyObject *__pyx_n_s_convert_pydata_sparse_to_scipy;
3654 : PyObject *__pyx_n_u_coo;
3655 : PyObject *__pyx_n_s_count;
3656 : PyObject *__pyx_n_u_csc;
3657 : PyObject *__pyx_n_u_csr;
3658 : PyObject *__pyx_n_s_data;
3659 : PyObject *__pyx_n_s_dict;
3660 : PyObject *__pyx_kp_u_disable;
3661 : PyObject *__pyx_n_s_double;
3662 : PyObject *__pyx_n_s_dtype;
3663 : PyObject *__pyx_n_s_dtype_is_object;
3664 : PyObject *__pyx_n_s_eliminate_zeros;
3665 : PyObject *__pyx_n_s_empty;
3666 : PyObject *__pyx_kp_u_enable;
3667 : PyObject *__pyx_n_s_encode;
3668 : PyObject *__pyx_n_s_enumerate;
3669 : PyObject *__pyx_n_s_error;
3670 : PyObject *__pyx_kp_u_expected_a_matrix_containing_num;
3671 : PyObject *__pyx_kp_u_explicit_zero_weights_are_remove;
3672 : PyObject *__pyx_n_s_flags;
3673 : PyObject *__pyx_n_s_float64;
3674 : PyObject *__pyx_n_s_format;
3675 : PyObject *__pyx_n_s_fortran;
3676 : PyObject *__pyx_n_u_fortran;
3677 : PyObject *__pyx_kp_u_gc;
3678 : PyObject *__pyx_n_s_getstate;
3679 : PyObject *__pyx_kp_u_got;
3680 : PyObject *__pyx_kp_u_got_2;
3681 : PyObject *__pyx_kp_u_got_differing_extents_in_dimensi;
3682 : PyObject *__pyx_n_s_graph;
3683 : PyObject *__pyx_kp_u_graph_must_be_in_CSC_CSR_or_COO;
3684 : PyObject *__pyx_kp_u_graph_must_be_sparse;
3685 : PyObject *__pyx_kp_s_home_czgdp18079_Quansight_scipy;
3686 : PyObject *__pyx_n_s_i;
3687 : PyObject *__pyx_n_s_id;
3688 : PyObject *__pyx_n_s_iinfo;
3689 : PyObject *__pyx_n_s_import;
3690 : PyObject *__pyx_n_s_index;
3691 : PyObject *__pyx_n_s_indices;
3692 : PyObject *__pyx_n_s_indptr;
3693 : PyObject *__pyx_n_s_initializing;
3694 : PyObject *__pyx_n_s_int32;
3695 : PyObject *__pyx_n_s_is_coroutine;
3696 : PyObject *__pyx_kp_u_isenabled;
3697 : PyObject *__pyx_n_s_isposinf;
3698 : PyObject *__pyx_n_s_issparse;
3699 : PyObject *__pyx_n_s_issubdtype;
3700 : PyObject *__pyx_n_s_itemsize;
3701 : PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
3702 : PyObject *__pyx_n_s_j;
3703 : PyObject *__pyx_n_s_main;
3704 : PyObject *__pyx_n_s_matching;
3705 : PyObject *__pyx_n_s_max;
3706 : PyObject *__pyx_n_s_maximize;
3707 : PyObject *__pyx_n_s_maximum_bipartite_matching;
3708 : PyObject *__pyx_kp_u_maximum_bipartite_matching_grap;
3709 : PyObject *__pyx_kp_u_maximum_bipartite_matching_line;
3710 : PyObject *__pyx_n_s_memview;
3711 : PyObject *__pyx_n_s_min;
3712 : PyObject *__pyx_kp_u_min_weight_full_bipartite_match;
3713 : PyObject *__pyx_n_s_min_weight_full_bipartite_matchi;
3714 : PyObject *__pyx_kp_u_min_weight_full_bipartite_matchi_2;
3715 : PyObject *__pyx_n_s_mode;
3716 : PyObject *__pyx_n_s_name;
3717 : PyObject *__pyx_n_s_name_2;
3718 : PyObject *__pyx_n_s_ndim;
3719 : PyObject *__pyx_n_s_new;
3720 : PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
3721 : PyObject *__pyx_kp_u_no_full_matching_exists;
3722 : PyObject *__pyx_n_s_np;
3723 : PyObject *__pyx_n_s_numpy;
3724 : PyObject *__pyx_kp_u_numpy__core_multiarray_failed_to;
3725 : PyObject *__pyx_kp_u_numpy__core_umath_failed_to_impo;
3726 : PyObject *__pyx_n_s_obj;
3727 : PyObject *__pyx_n_s_pack;
3728 : PyObject *__pyx_n_s_perm_type;
3729 : PyObject *__pyx_n_s_pickle;
3730 : PyObject *__pyx_n_s_pyx_PickleError;
3731 : PyObject *__pyx_n_s_pyx_checksum;
3732 : PyObject *__pyx_n_s_pyx_result;
3733 : PyObject *__pyx_n_s_pyx_state;
3734 : PyObject *__pyx_n_s_pyx_type;
3735 : PyObject *__pyx_n_s_pyx_unpickle_Enum;
3736 : PyObject *__pyx_n_s_pyx_vtable;
3737 : PyObject *__pyx_n_s_range;
3738 : PyObject *__pyx_n_s_reduce;
3739 : PyObject *__pyx_n_s_reduce_cython;
3740 : PyObject *__pyx_n_s_reduce_ex;
3741 : PyObject *__pyx_n_s_register;
3742 : PyObject *__pyx_n_u_row;
3743 : PyObject *__pyx_n_s_scipy_sparse;
3744 : PyObject *__pyx_n_s_scipy_sparse__sputils;
3745 : PyObject *__pyx_n_s_scipy_sparse_csgraph__matching;
3746 : PyObject *__pyx_n_s_setstate;
3747 : PyObject *__pyx_n_s_setstate_cython;
3748 : PyObject *__pyx_n_s_shape;
3749 : PyObject *__pyx_n_s_size;
3750 : PyObject *__pyx_n_s_spec;
3751 : PyObject *__pyx_n_s_start;
3752 : PyObject *__pyx_n_s_step;
3753 : PyObject *__pyx_n_s_stop;
3754 : PyObject *__pyx_kp_s_strided_and_direct;
3755 : PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3756 : PyObject *__pyx_kp_s_strided_and_indirect;
3757 : PyObject *__pyx_kp_s_stringsource;
3758 : PyObject *__pyx_n_s_struct;
3759 : PyObject *__pyx_n_s_sum;
3760 : PyObject *__pyx_n_s_sys;
3761 : PyObject *__pyx_n_s_test;
3762 : PyObject *__pyx_n_s_tocsr;
3763 : PyObject *__pyx_n_s_uint8;
3764 : PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3765 : PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3766 : PyObject *__pyx_n_s_unpack;
3767 : PyObject *__pyx_n_s_update;
3768 : PyObject *__pyx_n_s_version_info;
3769 : PyObject *__pyx_n_s_warn;
3770 : PyObject *__pyx_n_s_warnings;
3771 : PyObject *__pyx_n_s_x;
3772 : PyObject *__pyx_n_s_y;
3773 : PyObject *__pyx_n_s_zeros;
3774 : PyObject *__pyx_int_0;
3775 : PyObject *__pyx_int_1;
3776 : PyObject *__pyx_int_3;
3777 : PyObject *__pyx_int_112105877;
3778 : PyObject *__pyx_int_136983863;
3779 : PyObject *__pyx_int_184977713;
3780 : PyObject *__pyx_int_neg_1;
3781 : PyObject *__pyx_slice__5;
3782 : PyObject *__pyx_tuple__4;
3783 : PyObject *__pyx_tuple__8;
3784 : PyObject *__pyx_tuple__9;
3785 : PyObject *__pyx_tuple__10;
3786 : PyObject *__pyx_tuple__11;
3787 : PyObject *__pyx_tuple__12;
3788 : PyObject *__pyx_tuple__13;
3789 : PyObject *__pyx_tuple__14;
3790 : PyObject *__pyx_tuple__15;
3791 : PyObject *__pyx_tuple__16;
3792 : PyObject *__pyx_tuple__17;
3793 : PyObject *__pyx_tuple__18;
3794 : PyObject *__pyx_tuple__19;
3795 : PyObject *__pyx_tuple__20;
3796 : PyObject *__pyx_tuple__21;
3797 : PyObject *__pyx_tuple__22;
3798 : PyObject *__pyx_tuple__23;
3799 : PyObject *__pyx_tuple__25;
3800 : PyObject *__pyx_tuple__27;
3801 : PyObject *__pyx_tuple__29;
3802 : PyObject *__pyx_tuple__31;
3803 : PyObject *__pyx_codeobj__24;
3804 : PyObject *__pyx_codeobj__26;
3805 : PyObject *__pyx_codeobj__30;
3806 : } __pyx_mstate;
3807 :
3808 : #if CYTHON_USE_MODULE_STATE
3809 : #ifdef __cplusplus
3810 : namespace {
3811 : extern struct PyModuleDef __pyx_moduledef;
3812 : } /* anonymous namespace */
3813 : #else
3814 : static struct PyModuleDef __pyx_moduledef;
3815 : #endif
3816 :
3817 : #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
3818 :
3819 : #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
3820 :
3821 : #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
3822 : #else
3823 : static __pyx_mstate __pyx_mstate_global_static =
3824 : #ifdef __cplusplus
3825 : {};
3826 : #else
3827 : {0};
3828 : #endif
3829 : static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
3830 : #endif
3831 : /* #### Code section: module_state_clear ### */
3832 : #if CYTHON_USE_MODULE_STATE
3833 : static int __pyx_m_clear(PyObject *m) {
3834 : __pyx_mstate *clear_module_state = __pyx_mstate(m);
3835 : if (!clear_module_state) return 0;
3836 : Py_CLEAR(clear_module_state->__pyx_d);
3837 : Py_CLEAR(clear_module_state->__pyx_b);
3838 : Py_CLEAR(clear_module_state->__pyx_cython_runtime);
3839 : Py_CLEAR(clear_module_state->__pyx_empty_tuple);
3840 : Py_CLEAR(clear_module_state->__pyx_empty_bytes);
3841 : Py_CLEAR(clear_module_state->__pyx_empty_unicode);
3842 : #ifdef __Pyx_CyFunction_USED
3843 : Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
3844 : #endif
3845 : #ifdef __Pyx_FusedFunction_USED
3846 : Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
3847 : #endif
3848 : Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
3849 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
3850 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
3851 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
3852 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
3853 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
3854 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
3855 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
3856 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
3857 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
3858 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
3859 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
3860 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
3861 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
3862 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
3863 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
3864 : Py_CLEAR(clear_module_state->__pyx_array_type);
3865 : Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
3866 : Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
3867 : Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
3868 : Py_CLEAR(clear_module_state->__pyx_memoryview_type);
3869 : Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
3870 : Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
3871 : Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
3872 : Py_CLEAR(clear_module_state->__pyx_kp_u_);
3873 : Py_CLEAR(clear_module_state->__pyx_n_s_ASCII);
3874 : Py_CLEAR(clear_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
3875 : Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
3876 : Py_CLEAR(clear_module_state->__pyx_n_s_BTYPE);
3877 : Py_CLEAR(clear_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
3878 : Py_CLEAR(clear_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
3879 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
3880 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
3881 : Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_index_with_type);
3882 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
3883 : Py_CLEAR(clear_module_state->__pyx_n_s_DTYPE);
3884 : Py_CLEAR(clear_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
3885 : Py_CLEAR(clear_module_state->__pyx_n_s_Ellipsis);
3886 : Py_CLEAR(clear_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
3887 : Py_CLEAR(clear_module_state->__pyx_n_s_ITYPE);
3888 : Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
3889 : Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
3890 : Py_CLEAR(clear_module_state->__pyx_n_s_IndexError);
3891 : Py_CLEAR(clear_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
3892 : Py_CLEAR(clear_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
3893 : Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
3894 : Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_shape_in_axis);
3895 : Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
3896 : Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
3897 : Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_object);
3898 : Py_CLEAR(clear_module_state->__pyx_n_b_O);
3899 : Py_CLEAR(clear_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
3900 : Py_CLEAR(clear_module_state->__pyx_n_s_PickleError);
3901 : Py_CLEAR(clear_module_state->__pyx_n_s_Sequence);
3902 : Py_CLEAR(clear_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
3903 : Py_CLEAR(clear_module_state->__pyx_n_s_T);
3904 : Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
3905 : Py_CLEAR(clear_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
3906 : Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
3907 : Py_CLEAR(clear_module_state->__pyx_n_s_View_MemoryView);
3908 : Py_CLEAR(clear_module_state->__pyx_kp_u__2);
3909 : Py_CLEAR(clear_module_state->__pyx_n_s__28);
3910 : Py_CLEAR(clear_module_state->__pyx_n_s__3);
3911 : Py_CLEAR(clear_module_state->__pyx_n_s__32);
3912 : Py_CLEAR(clear_module_state->__pyx_kp_u__6);
3913 : Py_CLEAR(clear_module_state->__pyx_kp_u__7);
3914 : Py_CLEAR(clear_module_state->__pyx_n_s_a);
3915 : Py_CLEAR(clear_module_state->__pyx_n_s_abc);
3916 : Py_CLEAR(clear_module_state->__pyx_n_s_all);
3917 : Py_CLEAR(clear_module_state->__pyx_n_s_allocate_buffer);
3918 : Py_CLEAR(clear_module_state->__pyx_kp_u_and);
3919 : Py_CLEAR(clear_module_state->__pyx_n_s_arange);
3920 : Py_CLEAR(clear_module_state->__pyx_n_s_argsort);
3921 : Py_CLEAR(clear_module_state->__pyx_n_s_asarray);
3922 : Py_CLEAR(clear_module_state->__pyx_n_s_astype);
3923 : Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
3924 : Py_CLEAR(clear_module_state->__pyx_n_s_b);
3925 : Py_CLEAR(clear_module_state->__pyx_n_s_base);
3926 : Py_CLEAR(clear_module_state->__pyx_n_s_biadjacency_matrix);
3927 : Py_CLEAR(clear_module_state->__pyx_n_s_biadjacency_matrix_t);
3928 : Py_CLEAR(clear_module_state->__pyx_n_s_bool);
3929 : Py_CLEAR(clear_module_state->__pyx_n_s_c);
3930 : Py_CLEAR(clear_module_state->__pyx_n_u_c);
3931 : Py_CLEAR(clear_module_state->__pyx_n_s_class);
3932 : Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
3933 : Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
3934 : Py_CLEAR(clear_module_state->__pyx_n_s_collections);
3935 : Py_CLEAR(clear_module_state->__pyx_kp_s_collections_abc);
3936 : Py_CLEAR(clear_module_state->__pyx_n_u_column);
3937 : Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_direct);
3938 : Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_indirect);
3939 : Py_CLEAR(clear_module_state->__pyx_n_s_convert_pydata_sparse_to_scipy);
3940 : Py_CLEAR(clear_module_state->__pyx_n_u_coo);
3941 : Py_CLEAR(clear_module_state->__pyx_n_s_count);
3942 : Py_CLEAR(clear_module_state->__pyx_n_u_csc);
3943 : Py_CLEAR(clear_module_state->__pyx_n_u_csr);
3944 : Py_CLEAR(clear_module_state->__pyx_n_s_data);
3945 : Py_CLEAR(clear_module_state->__pyx_n_s_dict);
3946 : Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
3947 : Py_CLEAR(clear_module_state->__pyx_n_s_double);
3948 : Py_CLEAR(clear_module_state->__pyx_n_s_dtype);
3949 : Py_CLEAR(clear_module_state->__pyx_n_s_dtype_is_object);
3950 : Py_CLEAR(clear_module_state->__pyx_n_s_eliminate_zeros);
3951 : Py_CLEAR(clear_module_state->__pyx_n_s_empty);
3952 : Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
3953 : Py_CLEAR(clear_module_state->__pyx_n_s_encode);
3954 : Py_CLEAR(clear_module_state->__pyx_n_s_enumerate);
3955 : Py_CLEAR(clear_module_state->__pyx_n_s_error);
3956 : Py_CLEAR(clear_module_state->__pyx_kp_u_expected_a_matrix_containing_num);
3957 : Py_CLEAR(clear_module_state->__pyx_kp_u_explicit_zero_weights_are_remove);
3958 : Py_CLEAR(clear_module_state->__pyx_n_s_flags);
3959 : Py_CLEAR(clear_module_state->__pyx_n_s_float64);
3960 : Py_CLEAR(clear_module_state->__pyx_n_s_format);
3961 : Py_CLEAR(clear_module_state->__pyx_n_s_fortran);
3962 : Py_CLEAR(clear_module_state->__pyx_n_u_fortran);
3963 : Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
3964 : Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
3965 : Py_CLEAR(clear_module_state->__pyx_kp_u_got);
3966 : Py_CLEAR(clear_module_state->__pyx_kp_u_got_2);
3967 : Py_CLEAR(clear_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
3968 : Py_CLEAR(clear_module_state->__pyx_n_s_graph);
3969 : Py_CLEAR(clear_module_state->__pyx_kp_u_graph_must_be_in_CSC_CSR_or_COO);
3970 : Py_CLEAR(clear_module_state->__pyx_kp_u_graph_must_be_sparse);
3971 : Py_CLEAR(clear_module_state->__pyx_kp_s_home_czgdp18079_Quansight_scipy);
3972 : Py_CLEAR(clear_module_state->__pyx_n_s_i);
3973 : Py_CLEAR(clear_module_state->__pyx_n_s_id);
3974 : Py_CLEAR(clear_module_state->__pyx_n_s_iinfo);
3975 : Py_CLEAR(clear_module_state->__pyx_n_s_import);
3976 : Py_CLEAR(clear_module_state->__pyx_n_s_index);
3977 : Py_CLEAR(clear_module_state->__pyx_n_s_indices);
3978 : Py_CLEAR(clear_module_state->__pyx_n_s_indptr);
3979 : Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
3980 : Py_CLEAR(clear_module_state->__pyx_n_s_int32);
3981 : Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
3982 : Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
3983 : Py_CLEAR(clear_module_state->__pyx_n_s_isposinf);
3984 : Py_CLEAR(clear_module_state->__pyx_n_s_issparse);
3985 : Py_CLEAR(clear_module_state->__pyx_n_s_issubdtype);
3986 : Py_CLEAR(clear_module_state->__pyx_n_s_itemsize);
3987 : Py_CLEAR(clear_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
3988 : Py_CLEAR(clear_module_state->__pyx_n_s_j);
3989 : Py_CLEAR(clear_module_state->__pyx_n_s_main);
3990 : Py_CLEAR(clear_module_state->__pyx_n_s_matching);
3991 : Py_CLEAR(clear_module_state->__pyx_n_s_max);
3992 : Py_CLEAR(clear_module_state->__pyx_n_s_maximize);
3993 : Py_CLEAR(clear_module_state->__pyx_n_s_maximum_bipartite_matching);
3994 : Py_CLEAR(clear_module_state->__pyx_kp_u_maximum_bipartite_matching_grap);
3995 : Py_CLEAR(clear_module_state->__pyx_kp_u_maximum_bipartite_matching_line);
3996 : Py_CLEAR(clear_module_state->__pyx_n_s_memview);
3997 : Py_CLEAR(clear_module_state->__pyx_n_s_min);
3998 : Py_CLEAR(clear_module_state->__pyx_kp_u_min_weight_full_bipartite_match);
3999 : Py_CLEAR(clear_module_state->__pyx_n_s_min_weight_full_bipartite_matchi);
4000 : Py_CLEAR(clear_module_state->__pyx_kp_u_min_weight_full_bipartite_matchi_2);
4001 : Py_CLEAR(clear_module_state->__pyx_n_s_mode);
4002 : Py_CLEAR(clear_module_state->__pyx_n_s_name);
4003 : Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
4004 : Py_CLEAR(clear_module_state->__pyx_n_s_ndim);
4005 : Py_CLEAR(clear_module_state->__pyx_n_s_new);
4006 : Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
4007 : Py_CLEAR(clear_module_state->__pyx_kp_u_no_full_matching_exists);
4008 : Py_CLEAR(clear_module_state->__pyx_n_s_np);
4009 : Py_CLEAR(clear_module_state->__pyx_n_s_numpy);
4010 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
4011 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
4012 : Py_CLEAR(clear_module_state->__pyx_n_s_obj);
4013 : Py_CLEAR(clear_module_state->__pyx_n_s_pack);
4014 : Py_CLEAR(clear_module_state->__pyx_n_s_perm_type);
4015 : Py_CLEAR(clear_module_state->__pyx_n_s_pickle);
4016 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError);
4017 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum);
4018 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result);
4019 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
4020 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type);
4021 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Enum);
4022 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
4023 : Py_CLEAR(clear_module_state->__pyx_n_s_range);
4024 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
4025 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
4026 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
4027 : Py_CLEAR(clear_module_state->__pyx_n_s_register);
4028 : Py_CLEAR(clear_module_state->__pyx_n_u_row);
4029 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_sparse);
4030 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_sparse__sputils);
4031 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_sparse_csgraph__matching);
4032 : Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
4033 : Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
4034 : Py_CLEAR(clear_module_state->__pyx_n_s_shape);
4035 : Py_CLEAR(clear_module_state->__pyx_n_s_size);
4036 : Py_CLEAR(clear_module_state->__pyx_n_s_spec);
4037 : Py_CLEAR(clear_module_state->__pyx_n_s_start);
4038 : Py_CLEAR(clear_module_state->__pyx_n_s_step);
4039 : Py_CLEAR(clear_module_state->__pyx_n_s_stop);
4040 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct);
4041 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
4042 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_indirect);
4043 : Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
4044 : Py_CLEAR(clear_module_state->__pyx_n_s_struct);
4045 : Py_CLEAR(clear_module_state->__pyx_n_s_sum);
4046 : Py_CLEAR(clear_module_state->__pyx_n_s_sys);
4047 : Py_CLEAR(clear_module_state->__pyx_n_s_test);
4048 : Py_CLEAR(clear_module_state->__pyx_n_s_tocsr);
4049 : Py_CLEAR(clear_module_state->__pyx_n_s_uint8);
4050 : Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_array_data);
4051 : Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
4052 : Py_CLEAR(clear_module_state->__pyx_n_s_unpack);
4053 : Py_CLEAR(clear_module_state->__pyx_n_s_update);
4054 : Py_CLEAR(clear_module_state->__pyx_n_s_version_info);
4055 : Py_CLEAR(clear_module_state->__pyx_n_s_warn);
4056 : Py_CLEAR(clear_module_state->__pyx_n_s_warnings);
4057 : Py_CLEAR(clear_module_state->__pyx_n_s_x);
4058 : Py_CLEAR(clear_module_state->__pyx_n_s_y);
4059 : Py_CLEAR(clear_module_state->__pyx_n_s_zeros);
4060 : Py_CLEAR(clear_module_state->__pyx_int_0);
4061 : Py_CLEAR(clear_module_state->__pyx_int_1);
4062 : Py_CLEAR(clear_module_state->__pyx_int_3);
4063 : Py_CLEAR(clear_module_state->__pyx_int_112105877);
4064 : Py_CLEAR(clear_module_state->__pyx_int_136983863);
4065 : Py_CLEAR(clear_module_state->__pyx_int_184977713);
4066 : Py_CLEAR(clear_module_state->__pyx_int_neg_1);
4067 : Py_CLEAR(clear_module_state->__pyx_slice__5);
4068 : Py_CLEAR(clear_module_state->__pyx_tuple__4);
4069 : Py_CLEAR(clear_module_state->__pyx_tuple__8);
4070 : Py_CLEAR(clear_module_state->__pyx_tuple__9);
4071 : Py_CLEAR(clear_module_state->__pyx_tuple__10);
4072 : Py_CLEAR(clear_module_state->__pyx_tuple__11);
4073 : Py_CLEAR(clear_module_state->__pyx_tuple__12);
4074 : Py_CLEAR(clear_module_state->__pyx_tuple__13);
4075 : Py_CLEAR(clear_module_state->__pyx_tuple__14);
4076 : Py_CLEAR(clear_module_state->__pyx_tuple__15);
4077 : Py_CLEAR(clear_module_state->__pyx_tuple__16);
4078 : Py_CLEAR(clear_module_state->__pyx_tuple__17);
4079 : Py_CLEAR(clear_module_state->__pyx_tuple__18);
4080 : Py_CLEAR(clear_module_state->__pyx_tuple__19);
4081 : Py_CLEAR(clear_module_state->__pyx_tuple__20);
4082 : Py_CLEAR(clear_module_state->__pyx_tuple__21);
4083 : Py_CLEAR(clear_module_state->__pyx_tuple__22);
4084 : Py_CLEAR(clear_module_state->__pyx_tuple__23);
4085 : Py_CLEAR(clear_module_state->__pyx_tuple__25);
4086 : Py_CLEAR(clear_module_state->__pyx_tuple__27);
4087 : Py_CLEAR(clear_module_state->__pyx_tuple__29);
4088 : Py_CLEAR(clear_module_state->__pyx_tuple__31);
4089 : Py_CLEAR(clear_module_state->__pyx_codeobj__24);
4090 : Py_CLEAR(clear_module_state->__pyx_codeobj__26);
4091 : Py_CLEAR(clear_module_state->__pyx_codeobj__30);
4092 : return 0;
4093 : }
4094 : #endif
4095 : /* #### Code section: module_state_traverse ### */
4096 : #if CYTHON_USE_MODULE_STATE
4097 : static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
4098 : __pyx_mstate *traverse_module_state = __pyx_mstate(m);
4099 : if (!traverse_module_state) return 0;
4100 : Py_VISIT(traverse_module_state->__pyx_d);
4101 : Py_VISIT(traverse_module_state->__pyx_b);
4102 : Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4103 : Py_VISIT(traverse_module_state->__pyx_empty_tuple);
4104 : Py_VISIT(traverse_module_state->__pyx_empty_bytes);
4105 : Py_VISIT(traverse_module_state->__pyx_empty_unicode);
4106 : #ifdef __Pyx_CyFunction_USED
4107 : Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4108 : #endif
4109 : #ifdef __Pyx_FusedFunction_USED
4110 : Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
4111 : #endif
4112 : Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4113 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4114 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4115 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4116 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4117 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4118 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4119 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4120 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4121 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4122 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4123 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4124 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4125 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4126 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4127 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4128 : Py_VISIT(traverse_module_state->__pyx_array_type);
4129 : Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
4130 : Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
4131 : Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
4132 : Py_VISIT(traverse_module_state->__pyx_memoryview_type);
4133 : Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
4134 : Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
4135 : Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
4136 : Py_VISIT(traverse_module_state->__pyx_kp_u_);
4137 : Py_VISIT(traverse_module_state->__pyx_n_s_ASCII);
4138 : Py_VISIT(traverse_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
4139 : Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
4140 : Py_VISIT(traverse_module_state->__pyx_n_s_BTYPE);
4141 : Py_VISIT(traverse_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
4142 : Py_VISIT(traverse_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
4143 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
4144 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
4145 : Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_index_with_type);
4146 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
4147 : Py_VISIT(traverse_module_state->__pyx_n_s_DTYPE);
4148 : Py_VISIT(traverse_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
4149 : Py_VISIT(traverse_module_state->__pyx_n_s_Ellipsis);
4150 : Py_VISIT(traverse_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
4151 : Py_VISIT(traverse_module_state->__pyx_n_s_ITYPE);
4152 : Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
4153 : Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
4154 : Py_VISIT(traverse_module_state->__pyx_n_s_IndexError);
4155 : Py_VISIT(traverse_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
4156 : Py_VISIT(traverse_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
4157 : Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
4158 : Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_shape_in_axis);
4159 : Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
4160 : Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
4161 : Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_object);
4162 : Py_VISIT(traverse_module_state->__pyx_n_b_O);
4163 : Py_VISIT(traverse_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
4164 : Py_VISIT(traverse_module_state->__pyx_n_s_PickleError);
4165 : Py_VISIT(traverse_module_state->__pyx_n_s_Sequence);
4166 : Py_VISIT(traverse_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
4167 : Py_VISIT(traverse_module_state->__pyx_n_s_T);
4168 : Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
4169 : Py_VISIT(traverse_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
4170 : Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
4171 : Py_VISIT(traverse_module_state->__pyx_n_s_View_MemoryView);
4172 : Py_VISIT(traverse_module_state->__pyx_kp_u__2);
4173 : Py_VISIT(traverse_module_state->__pyx_n_s__28);
4174 : Py_VISIT(traverse_module_state->__pyx_n_s__3);
4175 : Py_VISIT(traverse_module_state->__pyx_n_s__32);
4176 : Py_VISIT(traverse_module_state->__pyx_kp_u__6);
4177 : Py_VISIT(traverse_module_state->__pyx_kp_u__7);
4178 : Py_VISIT(traverse_module_state->__pyx_n_s_a);
4179 : Py_VISIT(traverse_module_state->__pyx_n_s_abc);
4180 : Py_VISIT(traverse_module_state->__pyx_n_s_all);
4181 : Py_VISIT(traverse_module_state->__pyx_n_s_allocate_buffer);
4182 : Py_VISIT(traverse_module_state->__pyx_kp_u_and);
4183 : Py_VISIT(traverse_module_state->__pyx_n_s_arange);
4184 : Py_VISIT(traverse_module_state->__pyx_n_s_argsort);
4185 : Py_VISIT(traverse_module_state->__pyx_n_s_asarray);
4186 : Py_VISIT(traverse_module_state->__pyx_n_s_astype);
4187 : Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
4188 : Py_VISIT(traverse_module_state->__pyx_n_s_b);
4189 : Py_VISIT(traverse_module_state->__pyx_n_s_base);
4190 : Py_VISIT(traverse_module_state->__pyx_n_s_biadjacency_matrix);
4191 : Py_VISIT(traverse_module_state->__pyx_n_s_biadjacency_matrix_t);
4192 : Py_VISIT(traverse_module_state->__pyx_n_s_bool);
4193 : Py_VISIT(traverse_module_state->__pyx_n_s_c);
4194 : Py_VISIT(traverse_module_state->__pyx_n_u_c);
4195 : Py_VISIT(traverse_module_state->__pyx_n_s_class);
4196 : Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
4197 : Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
4198 : Py_VISIT(traverse_module_state->__pyx_n_s_collections);
4199 : Py_VISIT(traverse_module_state->__pyx_kp_s_collections_abc);
4200 : Py_VISIT(traverse_module_state->__pyx_n_u_column);
4201 : Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_direct);
4202 : Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_indirect);
4203 : Py_VISIT(traverse_module_state->__pyx_n_s_convert_pydata_sparse_to_scipy);
4204 : Py_VISIT(traverse_module_state->__pyx_n_u_coo);
4205 : Py_VISIT(traverse_module_state->__pyx_n_s_count);
4206 : Py_VISIT(traverse_module_state->__pyx_n_u_csc);
4207 : Py_VISIT(traverse_module_state->__pyx_n_u_csr);
4208 : Py_VISIT(traverse_module_state->__pyx_n_s_data);
4209 : Py_VISIT(traverse_module_state->__pyx_n_s_dict);
4210 : Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
4211 : Py_VISIT(traverse_module_state->__pyx_n_s_double);
4212 : Py_VISIT(traverse_module_state->__pyx_n_s_dtype);
4213 : Py_VISIT(traverse_module_state->__pyx_n_s_dtype_is_object);
4214 : Py_VISIT(traverse_module_state->__pyx_n_s_eliminate_zeros);
4215 : Py_VISIT(traverse_module_state->__pyx_n_s_empty);
4216 : Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
4217 : Py_VISIT(traverse_module_state->__pyx_n_s_encode);
4218 : Py_VISIT(traverse_module_state->__pyx_n_s_enumerate);
4219 : Py_VISIT(traverse_module_state->__pyx_n_s_error);
4220 : Py_VISIT(traverse_module_state->__pyx_kp_u_expected_a_matrix_containing_num);
4221 : Py_VISIT(traverse_module_state->__pyx_kp_u_explicit_zero_weights_are_remove);
4222 : Py_VISIT(traverse_module_state->__pyx_n_s_flags);
4223 : Py_VISIT(traverse_module_state->__pyx_n_s_float64);
4224 : Py_VISIT(traverse_module_state->__pyx_n_s_format);
4225 : Py_VISIT(traverse_module_state->__pyx_n_s_fortran);
4226 : Py_VISIT(traverse_module_state->__pyx_n_u_fortran);
4227 : Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
4228 : Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
4229 : Py_VISIT(traverse_module_state->__pyx_kp_u_got);
4230 : Py_VISIT(traverse_module_state->__pyx_kp_u_got_2);
4231 : Py_VISIT(traverse_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
4232 : Py_VISIT(traverse_module_state->__pyx_n_s_graph);
4233 : Py_VISIT(traverse_module_state->__pyx_kp_u_graph_must_be_in_CSC_CSR_or_COO);
4234 : Py_VISIT(traverse_module_state->__pyx_kp_u_graph_must_be_sparse);
4235 : Py_VISIT(traverse_module_state->__pyx_kp_s_home_czgdp18079_Quansight_scipy);
4236 : Py_VISIT(traverse_module_state->__pyx_n_s_i);
4237 : Py_VISIT(traverse_module_state->__pyx_n_s_id);
4238 : Py_VISIT(traverse_module_state->__pyx_n_s_iinfo);
4239 : Py_VISIT(traverse_module_state->__pyx_n_s_import);
4240 : Py_VISIT(traverse_module_state->__pyx_n_s_index);
4241 : Py_VISIT(traverse_module_state->__pyx_n_s_indices);
4242 : Py_VISIT(traverse_module_state->__pyx_n_s_indptr);
4243 : Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
4244 : Py_VISIT(traverse_module_state->__pyx_n_s_int32);
4245 : Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
4246 : Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
4247 : Py_VISIT(traverse_module_state->__pyx_n_s_isposinf);
4248 : Py_VISIT(traverse_module_state->__pyx_n_s_issparse);
4249 : Py_VISIT(traverse_module_state->__pyx_n_s_issubdtype);
4250 : Py_VISIT(traverse_module_state->__pyx_n_s_itemsize);
4251 : Py_VISIT(traverse_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
4252 : Py_VISIT(traverse_module_state->__pyx_n_s_j);
4253 : Py_VISIT(traverse_module_state->__pyx_n_s_main);
4254 : Py_VISIT(traverse_module_state->__pyx_n_s_matching);
4255 : Py_VISIT(traverse_module_state->__pyx_n_s_max);
4256 : Py_VISIT(traverse_module_state->__pyx_n_s_maximize);
4257 : Py_VISIT(traverse_module_state->__pyx_n_s_maximum_bipartite_matching);
4258 : Py_VISIT(traverse_module_state->__pyx_kp_u_maximum_bipartite_matching_grap);
4259 : Py_VISIT(traverse_module_state->__pyx_kp_u_maximum_bipartite_matching_line);
4260 : Py_VISIT(traverse_module_state->__pyx_n_s_memview);
4261 : Py_VISIT(traverse_module_state->__pyx_n_s_min);
4262 : Py_VISIT(traverse_module_state->__pyx_kp_u_min_weight_full_bipartite_match);
4263 : Py_VISIT(traverse_module_state->__pyx_n_s_min_weight_full_bipartite_matchi);
4264 : Py_VISIT(traverse_module_state->__pyx_kp_u_min_weight_full_bipartite_matchi_2);
4265 : Py_VISIT(traverse_module_state->__pyx_n_s_mode);
4266 : Py_VISIT(traverse_module_state->__pyx_n_s_name);
4267 : Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
4268 : Py_VISIT(traverse_module_state->__pyx_n_s_ndim);
4269 : Py_VISIT(traverse_module_state->__pyx_n_s_new);
4270 : Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
4271 : Py_VISIT(traverse_module_state->__pyx_kp_u_no_full_matching_exists);
4272 : Py_VISIT(traverse_module_state->__pyx_n_s_np);
4273 : Py_VISIT(traverse_module_state->__pyx_n_s_numpy);
4274 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
4275 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
4276 : Py_VISIT(traverse_module_state->__pyx_n_s_obj);
4277 : Py_VISIT(traverse_module_state->__pyx_n_s_pack);
4278 : Py_VISIT(traverse_module_state->__pyx_n_s_perm_type);
4279 : Py_VISIT(traverse_module_state->__pyx_n_s_pickle);
4280 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError);
4281 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum);
4282 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result);
4283 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
4284 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type);
4285 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Enum);
4286 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
4287 : Py_VISIT(traverse_module_state->__pyx_n_s_range);
4288 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
4289 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
4290 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
4291 : Py_VISIT(traverse_module_state->__pyx_n_s_register);
4292 : Py_VISIT(traverse_module_state->__pyx_n_u_row);
4293 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_sparse);
4294 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_sparse__sputils);
4295 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_sparse_csgraph__matching);
4296 : Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
4297 : Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
4298 : Py_VISIT(traverse_module_state->__pyx_n_s_shape);
4299 : Py_VISIT(traverse_module_state->__pyx_n_s_size);
4300 : Py_VISIT(traverse_module_state->__pyx_n_s_spec);
4301 : Py_VISIT(traverse_module_state->__pyx_n_s_start);
4302 : Py_VISIT(traverse_module_state->__pyx_n_s_step);
4303 : Py_VISIT(traverse_module_state->__pyx_n_s_stop);
4304 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct);
4305 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
4306 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_indirect);
4307 : Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
4308 : Py_VISIT(traverse_module_state->__pyx_n_s_struct);
4309 : Py_VISIT(traverse_module_state->__pyx_n_s_sum);
4310 : Py_VISIT(traverse_module_state->__pyx_n_s_sys);
4311 : Py_VISIT(traverse_module_state->__pyx_n_s_test);
4312 : Py_VISIT(traverse_module_state->__pyx_n_s_tocsr);
4313 : Py_VISIT(traverse_module_state->__pyx_n_s_uint8);
4314 : Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_array_data);
4315 : Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
4316 : Py_VISIT(traverse_module_state->__pyx_n_s_unpack);
4317 : Py_VISIT(traverse_module_state->__pyx_n_s_update);
4318 : Py_VISIT(traverse_module_state->__pyx_n_s_version_info);
4319 : Py_VISIT(traverse_module_state->__pyx_n_s_warn);
4320 : Py_VISIT(traverse_module_state->__pyx_n_s_warnings);
4321 : Py_VISIT(traverse_module_state->__pyx_n_s_x);
4322 : Py_VISIT(traverse_module_state->__pyx_n_s_y);
4323 : Py_VISIT(traverse_module_state->__pyx_n_s_zeros);
4324 : Py_VISIT(traverse_module_state->__pyx_int_0);
4325 : Py_VISIT(traverse_module_state->__pyx_int_1);
4326 : Py_VISIT(traverse_module_state->__pyx_int_3);
4327 : Py_VISIT(traverse_module_state->__pyx_int_112105877);
4328 : Py_VISIT(traverse_module_state->__pyx_int_136983863);
4329 : Py_VISIT(traverse_module_state->__pyx_int_184977713);
4330 : Py_VISIT(traverse_module_state->__pyx_int_neg_1);
4331 : Py_VISIT(traverse_module_state->__pyx_slice__5);
4332 : Py_VISIT(traverse_module_state->__pyx_tuple__4);
4333 : Py_VISIT(traverse_module_state->__pyx_tuple__8);
4334 : Py_VISIT(traverse_module_state->__pyx_tuple__9);
4335 : Py_VISIT(traverse_module_state->__pyx_tuple__10);
4336 : Py_VISIT(traverse_module_state->__pyx_tuple__11);
4337 : Py_VISIT(traverse_module_state->__pyx_tuple__12);
4338 : Py_VISIT(traverse_module_state->__pyx_tuple__13);
4339 : Py_VISIT(traverse_module_state->__pyx_tuple__14);
4340 : Py_VISIT(traverse_module_state->__pyx_tuple__15);
4341 : Py_VISIT(traverse_module_state->__pyx_tuple__16);
4342 : Py_VISIT(traverse_module_state->__pyx_tuple__17);
4343 : Py_VISIT(traverse_module_state->__pyx_tuple__18);
4344 : Py_VISIT(traverse_module_state->__pyx_tuple__19);
4345 : Py_VISIT(traverse_module_state->__pyx_tuple__20);
4346 : Py_VISIT(traverse_module_state->__pyx_tuple__21);
4347 : Py_VISIT(traverse_module_state->__pyx_tuple__22);
4348 : Py_VISIT(traverse_module_state->__pyx_tuple__23);
4349 : Py_VISIT(traverse_module_state->__pyx_tuple__25);
4350 : Py_VISIT(traverse_module_state->__pyx_tuple__27);
4351 : Py_VISIT(traverse_module_state->__pyx_tuple__29);
4352 : Py_VISIT(traverse_module_state->__pyx_tuple__31);
4353 : Py_VISIT(traverse_module_state->__pyx_codeobj__24);
4354 : Py_VISIT(traverse_module_state->__pyx_codeobj__26);
4355 : Py_VISIT(traverse_module_state->__pyx_codeobj__30);
4356 : return 0;
4357 : }
4358 : #endif
4359 : /* #### Code section: module_state_defines ### */
4360 : #define __pyx_d __pyx_mstate_global->__pyx_d
4361 : #define __pyx_b __pyx_mstate_global->__pyx_b
4362 : #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
4363 : #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
4364 : #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
4365 : #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
4366 : #ifdef __Pyx_CyFunction_USED
4367 : #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
4368 : #endif
4369 : #ifdef __Pyx_FusedFunction_USED
4370 : #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
4371 : #endif
4372 : #ifdef __Pyx_Generator_USED
4373 : #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
4374 : #endif
4375 : #ifdef __Pyx_IterableCoroutine_USED
4376 : #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
4377 : #endif
4378 : #ifdef __Pyx_Coroutine_USED
4379 : #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
4380 : #endif
4381 : #ifdef __Pyx_Coroutine_USED
4382 : #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
4383 : #endif
4384 : #if CYTHON_USE_MODULE_STATE
4385 : #endif
4386 : #if CYTHON_USE_MODULE_STATE
4387 : #endif
4388 : #if CYTHON_USE_MODULE_STATE
4389 : #endif
4390 : #if CYTHON_USE_MODULE_STATE
4391 : #endif
4392 : #if CYTHON_USE_MODULE_STATE
4393 : #endif
4394 : #if CYTHON_USE_MODULE_STATE
4395 : #endif
4396 : #if CYTHON_USE_MODULE_STATE
4397 : #endif
4398 : #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
4399 : #if CYTHON_USE_MODULE_STATE
4400 : #endif
4401 : #if CYTHON_USE_MODULE_STATE
4402 : #endif
4403 : #if CYTHON_USE_MODULE_STATE
4404 : #endif
4405 : #if CYTHON_USE_MODULE_STATE
4406 : #endif
4407 : #if CYTHON_USE_MODULE_STATE
4408 : #endif
4409 : #define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype
4410 : #define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter
4411 : #define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast
4412 : #define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray
4413 : #define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic
4414 : #define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number
4415 : #define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer
4416 : #define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger
4417 : #define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger
4418 : #define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact
4419 : #define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating
4420 : #define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating
4421 : #define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible
4422 : #define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character
4423 : #define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc
4424 : #if CYTHON_USE_MODULE_STATE
4425 : #endif
4426 : #if CYTHON_USE_MODULE_STATE
4427 : #define __pyx_type___pyx_array __pyx_mstate_global->__pyx_type___pyx_array
4428 : #define __pyx_type___pyx_MemviewEnum __pyx_mstate_global->__pyx_type___pyx_MemviewEnum
4429 : #define __pyx_type___pyx_memoryview __pyx_mstate_global->__pyx_type___pyx_memoryview
4430 : #define __pyx_type___pyx_memoryviewslice __pyx_mstate_global->__pyx_type___pyx_memoryviewslice
4431 : #endif
4432 : #define __pyx_array_type __pyx_mstate_global->__pyx_array_type
4433 : #define __pyx_MemviewEnum_type __pyx_mstate_global->__pyx_MemviewEnum_type
4434 : #define __pyx_memoryview_type __pyx_mstate_global->__pyx_memoryview_type
4435 : #define __pyx_memoryviewslice_type __pyx_mstate_global->__pyx_memoryviewslice_type
4436 : #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
4437 : #define __pyx_n_s_ASCII __pyx_mstate_global->__pyx_n_s_ASCII
4438 : #define __pyx_kp_s_All_dimensions_preceding_dimensi __pyx_mstate_global->__pyx_kp_s_All_dimensions_preceding_dimensi
4439 : #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
4440 : #define __pyx_n_s_BTYPE __pyx_mstate_global->__pyx_n_s_BTYPE
4441 : #define __pyx_kp_s_Buffer_view_does_not_expose_stri __pyx_mstate_global->__pyx_kp_s_Buffer_view_does_not_expose_stri
4442 : #define __pyx_kp_s_Can_only_create_a_buffer_that_is __pyx_mstate_global->__pyx_kp_s_Can_only_create_a_buffer_that_is
4443 : #define __pyx_kp_s_Cannot_assign_to_read_only_memor __pyx_mstate_global->__pyx_kp_s_Cannot_assign_to_read_only_memor
4444 : #define __pyx_kp_s_Cannot_create_writable_memory_vi __pyx_mstate_global->__pyx_kp_s_Cannot_create_writable_memory_vi
4445 : #define __pyx_kp_u_Cannot_index_with_type __pyx_mstate_global->__pyx_kp_u_Cannot_index_with_type
4446 : #define __pyx_kp_s_Cannot_transpose_memoryview_with __pyx_mstate_global->__pyx_kp_s_Cannot_transpose_memoryview_with
4447 : #define __pyx_n_s_DTYPE __pyx_mstate_global->__pyx_n_s_DTYPE
4448 : #define __pyx_kp_s_Dimension_d_is_not_direct __pyx_mstate_global->__pyx_kp_s_Dimension_d_is_not_direct
4449 : #define __pyx_n_s_Ellipsis __pyx_mstate_global->__pyx_n_s_Ellipsis
4450 : #define __pyx_kp_s_Empty_shape_tuple_for_cython_arr __pyx_mstate_global->__pyx_kp_s_Empty_shape_tuple_for_cython_arr
4451 : #define __pyx_n_s_ITYPE __pyx_mstate_global->__pyx_n_s_ITYPE
4452 : #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
4453 : #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0
4454 : #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError
4455 : #define __pyx_kp_s_Index_out_of_bounds_axis_d __pyx_mstate_global->__pyx_kp_s_Index_out_of_bounds_axis_d
4456 : #define __pyx_kp_s_Indirect_dimensions_not_supporte __pyx_mstate_global->__pyx_kp_s_Indirect_dimensions_not_supporte
4457 : #define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr
4458 : #define __pyx_kp_u_Invalid_shape_in_axis __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis
4459 : #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
4460 : #define __pyx_kp_s_MemoryView_of_r_at_0x_x __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_at_0x_x
4461 : #define __pyx_kp_s_MemoryView_of_r_object __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_object
4462 : #define __pyx_n_b_O __pyx_mstate_global->__pyx_n_b_O
4463 : #define __pyx_kp_u_Out_of_bounds_on_buffer_access_a __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a
4464 : #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError
4465 : #define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence
4466 : #define __pyx_kp_s_Step_may_not_be_zero_axis_d __pyx_mstate_global->__pyx_kp_s_Step_may_not_be_zero_axis_d
4467 : #define __pyx_n_s_T __pyx_mstate_global->__pyx_n_s_T
4468 : #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
4469 : #define __pyx_kp_s_Unable_to_convert_item_to_object __pyx_mstate_global->__pyx_kp_s_Unable_to_convert_item_to_object
4470 : #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
4471 : #define __pyx_n_s_View_MemoryView __pyx_mstate_global->__pyx_n_s_View_MemoryView
4472 : #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2
4473 : #define __pyx_n_s__28 __pyx_mstate_global->__pyx_n_s__28
4474 : #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3
4475 : #define __pyx_n_s__32 __pyx_mstate_global->__pyx_n_s__32
4476 : #define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6
4477 : #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7
4478 : #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a
4479 : #define __pyx_n_s_abc __pyx_mstate_global->__pyx_n_s_abc
4480 : #define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all
4481 : #define __pyx_n_s_allocate_buffer __pyx_mstate_global->__pyx_n_s_allocate_buffer
4482 : #define __pyx_kp_u_and __pyx_mstate_global->__pyx_kp_u_and
4483 : #define __pyx_n_s_arange __pyx_mstate_global->__pyx_n_s_arange
4484 : #define __pyx_n_s_argsort __pyx_mstate_global->__pyx_n_s_argsort
4485 : #define __pyx_n_s_asarray __pyx_mstate_global->__pyx_n_s_asarray
4486 : #define __pyx_n_s_astype __pyx_mstate_global->__pyx_n_s_astype
4487 : #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
4488 : #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b
4489 : #define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base
4490 : #define __pyx_n_s_biadjacency_matrix __pyx_mstate_global->__pyx_n_s_biadjacency_matrix
4491 : #define __pyx_n_s_biadjacency_matrix_t __pyx_mstate_global->__pyx_n_s_biadjacency_matrix_t
4492 : #define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool
4493 : #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c
4494 : #define __pyx_n_u_c __pyx_mstate_global->__pyx_n_u_c
4495 : #define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class
4496 : #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
4497 : #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
4498 : #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections
4499 : #define __pyx_kp_s_collections_abc __pyx_mstate_global->__pyx_kp_s_collections_abc
4500 : #define __pyx_n_u_column __pyx_mstate_global->__pyx_n_u_column
4501 : #define __pyx_kp_s_contiguous_and_direct __pyx_mstate_global->__pyx_kp_s_contiguous_and_direct
4502 : #define __pyx_kp_s_contiguous_and_indirect __pyx_mstate_global->__pyx_kp_s_contiguous_and_indirect
4503 : #define __pyx_n_s_convert_pydata_sparse_to_scipy __pyx_mstate_global->__pyx_n_s_convert_pydata_sparse_to_scipy
4504 : #define __pyx_n_u_coo __pyx_mstate_global->__pyx_n_u_coo
4505 : #define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count
4506 : #define __pyx_n_u_csc __pyx_mstate_global->__pyx_n_u_csc
4507 : #define __pyx_n_u_csr __pyx_mstate_global->__pyx_n_u_csr
4508 : #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data
4509 : #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
4510 : #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
4511 : #define __pyx_n_s_double __pyx_mstate_global->__pyx_n_s_double
4512 : #define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype
4513 : #define __pyx_n_s_dtype_is_object __pyx_mstate_global->__pyx_n_s_dtype_is_object
4514 : #define __pyx_n_s_eliminate_zeros __pyx_mstate_global->__pyx_n_s_eliminate_zeros
4515 : #define __pyx_n_s_empty __pyx_mstate_global->__pyx_n_s_empty
4516 : #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
4517 : #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode
4518 : #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate
4519 : #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error
4520 : #define __pyx_kp_u_expected_a_matrix_containing_num __pyx_mstate_global->__pyx_kp_u_expected_a_matrix_containing_num
4521 : #define __pyx_kp_u_explicit_zero_weights_are_remove __pyx_mstate_global->__pyx_kp_u_explicit_zero_weights_are_remove
4522 : #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags
4523 : #define __pyx_n_s_float64 __pyx_mstate_global->__pyx_n_s_float64
4524 : #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format
4525 : #define __pyx_n_s_fortran __pyx_mstate_global->__pyx_n_s_fortran
4526 : #define __pyx_n_u_fortran __pyx_mstate_global->__pyx_n_u_fortran
4527 : #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
4528 : #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
4529 : #define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got
4530 : #define __pyx_kp_u_got_2 __pyx_mstate_global->__pyx_kp_u_got_2
4531 : #define __pyx_kp_u_got_differing_extents_in_dimensi __pyx_mstate_global->__pyx_kp_u_got_differing_extents_in_dimensi
4532 : #define __pyx_n_s_graph __pyx_mstate_global->__pyx_n_s_graph
4533 : #define __pyx_kp_u_graph_must_be_in_CSC_CSR_or_COO __pyx_mstate_global->__pyx_kp_u_graph_must_be_in_CSC_CSR_or_COO
4534 : #define __pyx_kp_u_graph_must_be_sparse __pyx_mstate_global->__pyx_kp_u_graph_must_be_sparse
4535 : #define __pyx_kp_s_home_czgdp18079_Quansight_scipy __pyx_mstate_global->__pyx_kp_s_home_czgdp18079_Quansight_scipy
4536 : #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
4537 : #define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id
4538 : #define __pyx_n_s_iinfo __pyx_mstate_global->__pyx_n_s_iinfo
4539 : #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
4540 : #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
4541 : #define __pyx_n_s_indices __pyx_mstate_global->__pyx_n_s_indices
4542 : #define __pyx_n_s_indptr __pyx_mstate_global->__pyx_n_s_indptr
4543 : #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
4544 : #define __pyx_n_s_int32 __pyx_mstate_global->__pyx_n_s_int32
4545 : #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
4546 : #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
4547 : #define __pyx_n_s_isposinf __pyx_mstate_global->__pyx_n_s_isposinf
4548 : #define __pyx_n_s_issparse __pyx_mstate_global->__pyx_n_s_issparse
4549 : #define __pyx_n_s_issubdtype __pyx_mstate_global->__pyx_n_s_issubdtype
4550 : #define __pyx_n_s_itemsize __pyx_mstate_global->__pyx_n_s_itemsize
4551 : #define __pyx_kp_s_itemsize_0_for_cython_array __pyx_mstate_global->__pyx_kp_s_itemsize_0_for_cython_array
4552 : #define __pyx_n_s_j __pyx_mstate_global->__pyx_n_s_j
4553 : #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
4554 : #define __pyx_n_s_matching __pyx_mstate_global->__pyx_n_s_matching
4555 : #define __pyx_n_s_max __pyx_mstate_global->__pyx_n_s_max
4556 : #define __pyx_n_s_maximize __pyx_mstate_global->__pyx_n_s_maximize
4557 : #define __pyx_n_s_maximum_bipartite_matching __pyx_mstate_global->__pyx_n_s_maximum_bipartite_matching
4558 : #define __pyx_kp_u_maximum_bipartite_matching_grap __pyx_mstate_global->__pyx_kp_u_maximum_bipartite_matching_grap
4559 : #define __pyx_kp_u_maximum_bipartite_matching_line __pyx_mstate_global->__pyx_kp_u_maximum_bipartite_matching_line
4560 : #define __pyx_n_s_memview __pyx_mstate_global->__pyx_n_s_memview
4561 : #define __pyx_n_s_min __pyx_mstate_global->__pyx_n_s_min
4562 : #define __pyx_kp_u_min_weight_full_bipartite_match __pyx_mstate_global->__pyx_kp_u_min_weight_full_bipartite_match
4563 : #define __pyx_n_s_min_weight_full_bipartite_matchi __pyx_mstate_global->__pyx_n_s_min_weight_full_bipartite_matchi
4564 : #define __pyx_kp_u_min_weight_full_bipartite_matchi_2 __pyx_mstate_global->__pyx_kp_u_min_weight_full_bipartite_matchi_2
4565 : #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode
4566 : #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
4567 : #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
4568 : #define __pyx_n_s_ndim __pyx_mstate_global->__pyx_n_s_ndim
4569 : #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
4570 : #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non
4571 : #define __pyx_kp_u_no_full_matching_exists __pyx_mstate_global->__pyx_kp_u_no_full_matching_exists
4572 : #define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np
4573 : #define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy
4574 : #define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to
4575 : #define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo
4576 : #define __pyx_n_s_obj __pyx_mstate_global->__pyx_n_s_obj
4577 : #define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack
4578 : #define __pyx_n_s_perm_type __pyx_mstate_global->__pyx_n_s_perm_type
4579 : #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle
4580 : #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError
4581 : #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum
4582 : #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result
4583 : #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
4584 : #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type
4585 : #define __pyx_n_s_pyx_unpickle_Enum __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Enum
4586 : #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
4587 : #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
4588 : #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
4589 : #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
4590 : #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
4591 : #define __pyx_n_s_register __pyx_mstate_global->__pyx_n_s_register
4592 : #define __pyx_n_u_row __pyx_mstate_global->__pyx_n_u_row
4593 : #define __pyx_n_s_scipy_sparse __pyx_mstate_global->__pyx_n_s_scipy_sparse
4594 : #define __pyx_n_s_scipy_sparse__sputils __pyx_mstate_global->__pyx_n_s_scipy_sparse__sputils
4595 : #define __pyx_n_s_scipy_sparse_csgraph__matching __pyx_mstate_global->__pyx_n_s_scipy_sparse_csgraph__matching
4596 : #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
4597 : #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
4598 : #define __pyx_n_s_shape __pyx_mstate_global->__pyx_n_s_shape
4599 : #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size
4600 : #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
4601 : #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
4602 : #define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step
4603 : #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop
4604 : #define __pyx_kp_s_strided_and_direct __pyx_mstate_global->__pyx_kp_s_strided_and_direct
4605 : #define __pyx_kp_s_strided_and_direct_or_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_direct_or_indirect
4606 : #define __pyx_kp_s_strided_and_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_indirect
4607 : #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
4608 : #define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct
4609 : #define __pyx_n_s_sum __pyx_mstate_global->__pyx_n_s_sum
4610 : #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys
4611 : #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
4612 : #define __pyx_n_s_tocsr __pyx_mstate_global->__pyx_n_s_tocsr
4613 : #define __pyx_n_s_uint8 __pyx_mstate_global->__pyx_n_s_uint8
4614 : #define __pyx_kp_s_unable_to_allocate_array_data __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_array_data
4615 : #define __pyx_kp_s_unable_to_allocate_shape_and_str __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_shape_and_str
4616 : #define __pyx_n_s_unpack __pyx_mstate_global->__pyx_n_s_unpack
4617 : #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update
4618 : #define __pyx_n_s_version_info __pyx_mstate_global->__pyx_n_s_version_info
4619 : #define __pyx_n_s_warn __pyx_mstate_global->__pyx_n_s_warn
4620 : #define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings
4621 : #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x
4622 : #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y
4623 : #define __pyx_n_s_zeros __pyx_mstate_global->__pyx_n_s_zeros
4624 : #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
4625 : #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
4626 : #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3
4627 : #define __pyx_int_112105877 __pyx_mstate_global->__pyx_int_112105877
4628 : #define __pyx_int_136983863 __pyx_mstate_global->__pyx_int_136983863
4629 : #define __pyx_int_184977713 __pyx_mstate_global->__pyx_int_184977713
4630 : #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1
4631 : #define __pyx_slice__5 __pyx_mstate_global->__pyx_slice__5
4632 : #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
4633 : #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8
4634 : #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9
4635 : #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10
4636 : #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11
4637 : #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12
4638 : #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13
4639 : #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14
4640 : #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
4641 : #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16
4642 : #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17
4643 : #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
4644 : #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19
4645 : #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20
4646 : #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21
4647 : #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22
4648 : #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23
4649 : #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25
4650 : #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27
4651 : #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29
4652 : #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31
4653 : #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24
4654 : #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26
4655 : #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30
4656 : /* #### Code section: module_code ### */
4657 :
4658 : /* "View.MemoryView":131
4659 : * cdef bint dtype_is_object
4660 : *
4661 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4662 : * mode="c", bint allocate_buffer=True):
4663 : *
4664 : */
4665 :
4666 : /* Python wrapper */
4667 : static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4668 0 : static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4669 0 : PyObject *__pyx_v_shape = 0;
4670 0 : Py_ssize_t __pyx_v_itemsize;
4671 0 : PyObject *__pyx_v_format = 0;
4672 0 : PyObject *__pyx_v_mode = 0;
4673 0 : int __pyx_v_allocate_buffer;
4674 0 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
4675 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
4676 0 : PyObject* values[5] = {0,0,0,0,0};
4677 0 : int __pyx_lineno = 0;
4678 0 : const char *__pyx_filename = NULL;
4679 0 : int __pyx_clineno = 0;
4680 0 : int __pyx_r;
4681 : __Pyx_RefNannyDeclarations
4682 0 : __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4683 : #if CYTHON_ASSUME_SAFE_MACROS
4684 0 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
4685 : #else
4686 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
4687 : #endif
4688 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
4689 : {
4690 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
4691 0 : values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_s_c));
4692 0 : if (__pyx_kwds) {
4693 0 : Py_ssize_t kw_args;
4694 0 : switch (__pyx_nargs) {
4695 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
4696 0 : CYTHON_FALLTHROUGH;
4697 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
4698 0 : CYTHON_FALLTHROUGH;
4699 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
4700 0 : CYTHON_FALLTHROUGH;
4701 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
4702 0 : CYTHON_FALLTHROUGH;
4703 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
4704 0 : CYTHON_FALLTHROUGH;
4705 0 : case 0: break;
4706 0 : default: goto __pyx_L5_argtuple_error;
4707 : }
4708 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
4709 0 : switch (__pyx_nargs) {
4710 0 : case 0:
4711 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shape)) != 0)) {
4712 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
4713 0 : kw_args--;
4714 : }
4715 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4716 0 : else goto __pyx_L5_argtuple_error;
4717 0 : CYTHON_FALLTHROUGH;
4718 : case 1:
4719 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_itemsize)) != 0)) {
4720 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
4721 0 : kw_args--;
4722 : }
4723 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4724 : else {
4725 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 131, __pyx_L3_error)
4726 : }
4727 0 : CYTHON_FALLTHROUGH;
4728 : case 2:
4729 0 : if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) {
4730 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
4731 0 : kw_args--;
4732 : }
4733 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4734 : else {
4735 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 131, __pyx_L3_error)
4736 : }
4737 0 : CYTHON_FALLTHROUGH;
4738 : case 3:
4739 0 : if (kw_args > 0) {
4740 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode);
4741 0 : if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
4742 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4743 : }
4744 0 : CYTHON_FALLTHROUGH;
4745 : case 4:
4746 0 : if (kw_args > 0) {
4747 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_allocate_buffer);
4748 0 : if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
4749 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4750 : }
4751 : }
4752 0 : if (unlikely(kw_args > 0)) {
4753 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
4754 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 131, __pyx_L3_error)
4755 : }
4756 : } else {
4757 0 : switch (__pyx_nargs) {
4758 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
4759 0 : CYTHON_FALLTHROUGH;
4760 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
4761 0 : CYTHON_FALLTHROUGH;
4762 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
4763 0 : values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
4764 0 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
4765 0 : break;
4766 0 : default: goto __pyx_L5_argtuple_error;
4767 : }
4768 : }
4769 0 : __pyx_v_shape = ((PyObject*)values[0]);
4770 0 : __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4771 0 : __pyx_v_format = values[2];
4772 0 : __pyx_v_mode = values[3];
4773 0 : if (values[4]) {
4774 0 : __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 132, __pyx_L3_error)
4775 : } else {
4776 :
4777 : /* "View.MemoryView":132
4778 : *
4779 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
4780 : * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
4781 : *
4782 : * cdef int idx
4783 : */
4784 : __pyx_v_allocate_buffer = ((int)1);
4785 : }
4786 : }
4787 0 : goto __pyx_L6_skip;
4788 0 : __pyx_L5_argtuple_error:;
4789 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 131, __pyx_L3_error)
4790 0 : __pyx_L6_skip:;
4791 0 : goto __pyx_L4_argument_unpacking_done;
4792 0 : __pyx_L3_error:;
4793 : {
4794 0 : Py_ssize_t __pyx_temp;
4795 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4796 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
4797 : }
4798 : }
4799 0 : __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4800 0 : __Pyx_RefNannyFinishContext();
4801 0 : return -1;
4802 0 : __pyx_L4_argument_unpacking_done:;
4803 0 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 131, __pyx_L1_error)
4804 0 : if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
4805 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 131, __pyx_L1_error)
4806 : }
4807 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
4808 :
4809 : /* "View.MemoryView":131
4810 : * cdef bint dtype_is_object
4811 : *
4812 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4813 : * mode="c", bint allocate_buffer=True):
4814 : *
4815 : */
4816 :
4817 : /* function exit code */
4818 0 : goto __pyx_L0;
4819 : __pyx_L1_error:;
4820 : __pyx_r = -1;
4821 0 : __pyx_L0:;
4822 : {
4823 0 : Py_ssize_t __pyx_temp;
4824 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4825 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
4826 : }
4827 : }
4828 : __Pyx_RefNannyFinishContext();
4829 : return __pyx_r;
4830 : }
4831 :
4832 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
4833 0 : int __pyx_v_idx;
4834 0 : Py_ssize_t __pyx_v_dim;
4835 0 : char __pyx_v_order;
4836 0 : int __pyx_r;
4837 : __Pyx_RefNannyDeclarations
4838 0 : Py_ssize_t __pyx_t_1;
4839 0 : int __pyx_t_2;
4840 0 : int __pyx_t_3;
4841 0 : PyObject *__pyx_t_4 = NULL;
4842 0 : PyObject *__pyx_t_5 = NULL;
4843 0 : PyObject *__pyx_t_6 = NULL;
4844 0 : unsigned int __pyx_t_7;
4845 0 : char *__pyx_t_8;
4846 0 : int __pyx_t_9;
4847 0 : Py_ssize_t __pyx_t_10;
4848 0 : Py_UCS4 __pyx_t_11;
4849 0 : int __pyx_lineno = 0;
4850 0 : const char *__pyx_filename = NULL;
4851 0 : int __pyx_clineno = 0;
4852 0 : __Pyx_RefNannySetupContext("__cinit__", 0);
4853 0 : __Pyx_INCREF(__pyx_v_format);
4854 :
4855 : /* "View.MemoryView":137
4856 : * cdef Py_ssize_t dim
4857 : *
4858 : * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
4859 : * self.itemsize = itemsize
4860 : *
4861 : */
4862 0 : if (unlikely(__pyx_v_shape == Py_None)) {
4863 0 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
4864 0 : __PYX_ERR(1, 137, __pyx_L1_error)
4865 : }
4866 0 : __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 137, __pyx_L1_error)
4867 0 : __pyx_v_self->ndim = ((int)__pyx_t_1);
4868 :
4869 : /* "View.MemoryView":138
4870 : *
4871 : * self.ndim = <int> len(shape)
4872 : * self.itemsize = itemsize # <<<<<<<<<<<<<<
4873 : *
4874 : * if not self.ndim:
4875 : */
4876 0 : __pyx_v_self->itemsize = __pyx_v_itemsize;
4877 :
4878 : /* "View.MemoryView":140
4879 : * self.itemsize = itemsize
4880 : *
4881 : * if not self.ndim: # <<<<<<<<<<<<<<
4882 : * raise ValueError, "Empty shape tuple for cython.array"
4883 : *
4884 : */
4885 0 : __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
4886 0 : if (unlikely(__pyx_t_2)) {
4887 :
4888 : /* "View.MemoryView":141
4889 : *
4890 : * if not self.ndim:
4891 : * raise ValueError, "Empty shape tuple for cython.array" # <<<<<<<<<<<<<<
4892 : *
4893 : * if itemsize <= 0:
4894 : */
4895 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Empty_shape_tuple_for_cython_arr, 0, 0);
4896 0 : __PYX_ERR(1, 141, __pyx_L1_error)
4897 :
4898 : /* "View.MemoryView":140
4899 : * self.itemsize = itemsize
4900 : *
4901 : * if not self.ndim: # <<<<<<<<<<<<<<
4902 : * raise ValueError, "Empty shape tuple for cython.array"
4903 : *
4904 : */
4905 : }
4906 :
4907 : /* "View.MemoryView":143
4908 : * raise ValueError, "Empty shape tuple for cython.array"
4909 : *
4910 : * if itemsize <= 0: # <<<<<<<<<<<<<<
4911 : * raise ValueError, "itemsize <= 0 for cython.array"
4912 : *
4913 : */
4914 0 : __pyx_t_2 = (__pyx_v_itemsize <= 0);
4915 0 : if (unlikely(__pyx_t_2)) {
4916 :
4917 : /* "View.MemoryView":144
4918 : *
4919 : * if itemsize <= 0:
4920 : * raise ValueError, "itemsize <= 0 for cython.array" # <<<<<<<<<<<<<<
4921 : *
4922 : * if not isinstance(format, bytes):
4923 : */
4924 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_itemsize_0_for_cython_array, 0, 0);
4925 0 : __PYX_ERR(1, 144, __pyx_L1_error)
4926 :
4927 : /* "View.MemoryView":143
4928 : * raise ValueError, "Empty shape tuple for cython.array"
4929 : *
4930 : * if itemsize <= 0: # <<<<<<<<<<<<<<
4931 : * raise ValueError, "itemsize <= 0 for cython.array"
4932 : *
4933 : */
4934 : }
4935 :
4936 : /* "View.MemoryView":146
4937 : * raise ValueError, "itemsize <= 0 for cython.array"
4938 : *
4939 : * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
4940 : * format = format.encode('ASCII')
4941 : * self._format = format # keep a reference to the byte string
4942 : */
4943 0 : __pyx_t_2 = PyBytes_Check(__pyx_v_format);
4944 0 : __pyx_t_3 = (!__pyx_t_2);
4945 0 : if (__pyx_t_3) {
4946 :
4947 : /* "View.MemoryView":147
4948 : *
4949 : * if not isinstance(format, bytes):
4950 : * format = format.encode('ASCII') # <<<<<<<<<<<<<<
4951 : * self._format = format # keep a reference to the byte string
4952 : * self.format = self._format
4953 : */
4954 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error)
4955 0 : __Pyx_GOTREF(__pyx_t_5);
4956 0 : __pyx_t_6 = NULL;
4957 0 : __pyx_t_7 = 0;
4958 : #if CYTHON_UNPACK_METHODS
4959 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
4960 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
4961 0 : if (likely(__pyx_t_6)) {
4962 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
4963 0 : __Pyx_INCREF(__pyx_t_6);
4964 0 : __Pyx_INCREF(function);
4965 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
4966 : __pyx_t_7 = 1;
4967 : }
4968 : }
4969 : #endif
4970 : {
4971 0 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_n_s_ASCII};
4972 0 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
4973 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4974 0 : if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 147, __pyx_L1_error)
4975 0 : __Pyx_GOTREF(__pyx_t_4);
4976 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4977 : }
4978 0 : __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_4);
4979 : __pyx_t_4 = 0;
4980 :
4981 : /* "View.MemoryView":146
4982 : * raise ValueError, "itemsize <= 0 for cython.array"
4983 : *
4984 : * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
4985 : * format = format.encode('ASCII')
4986 : * self._format = format # keep a reference to the byte string
4987 : */
4988 : }
4989 :
4990 : /* "View.MemoryView":148
4991 : * if not isinstance(format, bytes):
4992 : * format = format.encode('ASCII')
4993 : * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
4994 : * self.format = self._format
4995 : *
4996 : */
4997 0 : if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_format))) __PYX_ERR(1, 148, __pyx_L1_error)
4998 0 : __pyx_t_4 = __pyx_v_format;
4999 0 : __Pyx_INCREF(__pyx_t_4);
5000 0 : __Pyx_GIVEREF(__pyx_t_4);
5001 0 : __Pyx_GOTREF(__pyx_v_self->_format);
5002 0 : __Pyx_DECREF(__pyx_v_self->_format);
5003 0 : __pyx_v_self->_format = ((PyObject*)__pyx_t_4);
5004 0 : __pyx_t_4 = 0;
5005 :
5006 : /* "View.MemoryView":149
5007 : * format = format.encode('ASCII')
5008 : * self._format = format # keep a reference to the byte string
5009 : * self.format = self._format # <<<<<<<<<<<<<<
5010 : *
5011 : *
5012 : */
5013 0 : if (unlikely(__pyx_v_self->_format == Py_None)) {
5014 0 : PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
5015 0 : __PYX_ERR(1, 149, __pyx_L1_error)
5016 : }
5017 0 : __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
5018 0 : __pyx_v_self->format = __pyx_t_8;
5019 :
5020 : /* "View.MemoryView":152
5021 : *
5022 : *
5023 : * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
5024 : * self._strides = self._shape + self.ndim
5025 : *
5026 : */
5027 0 : __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
5028 :
5029 : /* "View.MemoryView":153
5030 : *
5031 : * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
5032 : * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
5033 : *
5034 : * if not self._shape:
5035 : */
5036 0 : __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
5037 :
5038 : /* "View.MemoryView":155
5039 : * self._strides = self._shape + self.ndim
5040 : *
5041 : * if not self._shape: # <<<<<<<<<<<<<<
5042 : * raise MemoryError, "unable to allocate shape and strides."
5043 : *
5044 : */
5045 0 : __pyx_t_3 = (!(__pyx_v_self->_shape != 0));
5046 0 : if (unlikely(__pyx_t_3)) {
5047 :
5048 : /* "View.MemoryView":156
5049 : *
5050 : * if not self._shape:
5051 : * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
5052 : *
5053 : *
5054 : */
5055 0 : __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_shape_and_str, 0, 0);
5056 0 : __PYX_ERR(1, 156, __pyx_L1_error)
5057 :
5058 : /* "View.MemoryView":155
5059 : * self._strides = self._shape + self.ndim
5060 : *
5061 : * if not self._shape: # <<<<<<<<<<<<<<
5062 : * raise MemoryError, "unable to allocate shape and strides."
5063 : *
5064 : */
5065 : }
5066 :
5067 : /* "View.MemoryView":159
5068 : *
5069 : *
5070 : * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5071 : * if dim <= 0:
5072 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5073 : */
5074 0 : __pyx_t_9 = 0;
5075 0 : __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4);
5076 : __pyx_t_1 = 0;
5077 0 : for (;;) {
5078 0 : {
5079 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
5080 : #if !CYTHON_ASSUME_SAFE_MACROS
5081 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
5082 : #endif
5083 0 : if (__pyx_t_1 >= __pyx_temp) break;
5084 : }
5085 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5086 0 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
5087 : #else
5088 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 159, __pyx_L1_error)
5089 : __Pyx_GOTREF(__pyx_t_5);
5090 : #endif
5091 0 : __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L1_error)
5092 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5093 0 : __pyx_v_dim = __pyx_t_10;
5094 0 : __pyx_v_idx = __pyx_t_9;
5095 0 : __pyx_t_9 = (__pyx_t_9 + 1);
5096 :
5097 : /* "View.MemoryView":160
5098 : *
5099 : * for idx, dim in enumerate(shape):
5100 : * if dim <= 0: # <<<<<<<<<<<<<<
5101 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5102 : * self._shape[idx] = dim
5103 : */
5104 0 : __pyx_t_3 = (__pyx_v_dim <= 0);
5105 0 : if (unlikely(__pyx_t_3)) {
5106 :
5107 : /* "View.MemoryView":161
5108 : * for idx, dim in enumerate(shape):
5109 : * if dim <= 0:
5110 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
5111 : * self._shape[idx] = dim
5112 : *
5113 : */
5114 0 : __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 161, __pyx_L1_error)
5115 0 : __Pyx_GOTREF(__pyx_t_5);
5116 0 : __pyx_t_10 = 0;
5117 0 : __pyx_t_11 = 127;
5118 0 : __Pyx_INCREF(__pyx_kp_u_Invalid_shape_in_axis);
5119 0 : __pyx_t_10 += 22;
5120 0 : __Pyx_GIVEREF(__pyx_kp_u_Invalid_shape_in_axis);
5121 0 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Invalid_shape_in_axis);
5122 0 : __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5123 0 : __Pyx_GOTREF(__pyx_t_6);
5124 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
5125 0 : __Pyx_GIVEREF(__pyx_t_6);
5126 0 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
5127 0 : __pyx_t_6 = 0;
5128 0 : __Pyx_INCREF(__pyx_kp_u_);
5129 0 : __pyx_t_10 += 2;
5130 0 : __Pyx_GIVEREF(__pyx_kp_u_);
5131 0 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_);
5132 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5133 0 : __Pyx_GOTREF(__pyx_t_6);
5134 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
5135 0 : __Pyx_GIVEREF(__pyx_t_6);
5136 0 : PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6);
5137 0 : __pyx_t_6 = 0;
5138 0 : __Pyx_INCREF(__pyx_kp_u__2);
5139 0 : __pyx_t_10 += 1;
5140 0 : __Pyx_GIVEREF(__pyx_kp_u__2);
5141 0 : PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__2);
5142 0 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5143 0 : __Pyx_GOTREF(__pyx_t_6);
5144 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5145 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
5146 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5147 0 : __PYX_ERR(1, 161, __pyx_L1_error)
5148 :
5149 : /* "View.MemoryView":160
5150 : *
5151 : * for idx, dim in enumerate(shape):
5152 : * if dim <= 0: # <<<<<<<<<<<<<<
5153 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5154 : * self._shape[idx] = dim
5155 : */
5156 : }
5157 :
5158 : /* "View.MemoryView":162
5159 : * if dim <= 0:
5160 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5161 : * self._shape[idx] = dim # <<<<<<<<<<<<<<
5162 : *
5163 : * cdef char order
5164 : */
5165 0 : (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
5166 :
5167 : /* "View.MemoryView":159
5168 : *
5169 : *
5170 : * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5171 : * if dim <= 0:
5172 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5173 : */
5174 : }
5175 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5176 :
5177 : /* "View.MemoryView":165
5178 : *
5179 : * cdef char order
5180 : * if mode == 'c': # <<<<<<<<<<<<<<
5181 : * order = b'C'
5182 : * self.mode = u'c'
5183 : */
5184 0 : __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 165, __pyx_L1_error)
5185 0 : if (__pyx_t_3) {
5186 :
5187 : /* "View.MemoryView":166
5188 : * cdef char order
5189 : * if mode == 'c':
5190 : * order = b'C' # <<<<<<<<<<<<<<
5191 : * self.mode = u'c'
5192 : * elif mode == 'fortran':
5193 : */
5194 0 : __pyx_v_order = 'C';
5195 :
5196 : /* "View.MemoryView":167
5197 : * if mode == 'c':
5198 : * order = b'C'
5199 : * self.mode = u'c' # <<<<<<<<<<<<<<
5200 : * elif mode == 'fortran':
5201 : * order = b'F'
5202 : */
5203 0 : __Pyx_INCREF(__pyx_n_u_c);
5204 0 : __Pyx_GIVEREF(__pyx_n_u_c);
5205 0 : __Pyx_GOTREF(__pyx_v_self->mode);
5206 0 : __Pyx_DECREF(__pyx_v_self->mode);
5207 0 : __pyx_v_self->mode = __pyx_n_u_c;
5208 :
5209 : /* "View.MemoryView":165
5210 : *
5211 : * cdef char order
5212 : * if mode == 'c': # <<<<<<<<<<<<<<
5213 : * order = b'C'
5214 : * self.mode = u'c'
5215 : */
5216 0 : goto __pyx_L11;
5217 : }
5218 :
5219 : /* "View.MemoryView":168
5220 : * order = b'C'
5221 : * self.mode = u'c'
5222 : * elif mode == 'fortran': # <<<<<<<<<<<<<<
5223 : * order = b'F'
5224 : * self.mode = u'fortran'
5225 : */
5226 0 : __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 168, __pyx_L1_error)
5227 0 : if (likely(__pyx_t_3)) {
5228 :
5229 : /* "View.MemoryView":169
5230 : * self.mode = u'c'
5231 : * elif mode == 'fortran':
5232 : * order = b'F' # <<<<<<<<<<<<<<
5233 : * self.mode = u'fortran'
5234 : * else:
5235 : */
5236 0 : __pyx_v_order = 'F';
5237 :
5238 : /* "View.MemoryView":170
5239 : * elif mode == 'fortran':
5240 : * order = b'F'
5241 : * self.mode = u'fortran' # <<<<<<<<<<<<<<
5242 : * else:
5243 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5244 : */
5245 0 : __Pyx_INCREF(__pyx_n_u_fortran);
5246 0 : __Pyx_GIVEREF(__pyx_n_u_fortran);
5247 0 : __Pyx_GOTREF(__pyx_v_self->mode);
5248 0 : __Pyx_DECREF(__pyx_v_self->mode);
5249 0 : __pyx_v_self->mode = __pyx_n_u_fortran;
5250 :
5251 : /* "View.MemoryView":168
5252 : * order = b'C'
5253 : * self.mode = u'c'
5254 : * elif mode == 'fortran': # <<<<<<<<<<<<<<
5255 : * order = b'F'
5256 : * self.mode = u'fortran'
5257 : */
5258 0 : goto __pyx_L11;
5259 : }
5260 :
5261 : /* "View.MemoryView":172
5262 : * self.mode = u'fortran'
5263 : * else:
5264 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
5265 : *
5266 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5267 : */
5268 : /*else*/ {
5269 0 : __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 172, __pyx_L1_error)
5270 0 : __Pyx_GOTREF(__pyx_t_4);
5271 0 : __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 172, __pyx_L1_error)
5272 0 : __Pyx_GOTREF(__pyx_t_6);
5273 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5274 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
5275 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5276 0 : __PYX_ERR(1, 172, __pyx_L1_error)
5277 : }
5278 0 : __pyx_L11:;
5279 :
5280 : /* "View.MemoryView":174
5281 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5282 : *
5283 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
5284 : *
5285 : * self.free_data = allocate_buffer
5286 : */
5287 0 : __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
5288 :
5289 : /* "View.MemoryView":176
5290 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5291 : *
5292 : * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
5293 : * self.dtype_is_object = format == b'O'
5294 : *
5295 : */
5296 0 : __pyx_v_self->free_data = __pyx_v_allocate_buffer;
5297 :
5298 : /* "View.MemoryView":177
5299 : *
5300 : * self.free_data = allocate_buffer
5301 : * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
5302 : *
5303 : * if allocate_buffer:
5304 : */
5305 0 : __pyx_t_6 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
5306 0 : __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 177, __pyx_L1_error)
5307 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5308 0 : __pyx_v_self->dtype_is_object = __pyx_t_3;
5309 :
5310 : /* "View.MemoryView":179
5311 : * self.dtype_is_object = format == b'O'
5312 : *
5313 : * if allocate_buffer: # <<<<<<<<<<<<<<
5314 : * _allocate_buffer(self)
5315 : *
5316 : */
5317 0 : if (__pyx_v_allocate_buffer) {
5318 :
5319 : /* "View.MemoryView":180
5320 : *
5321 : * if allocate_buffer:
5322 : * _allocate_buffer(self) # <<<<<<<<<<<<<<
5323 : *
5324 : * @cname('getbuffer')
5325 : */
5326 0 : __pyx_t_9 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 180, __pyx_L1_error)
5327 :
5328 : /* "View.MemoryView":179
5329 : * self.dtype_is_object = format == b'O'
5330 : *
5331 : * if allocate_buffer: # <<<<<<<<<<<<<<
5332 : * _allocate_buffer(self)
5333 : *
5334 : */
5335 : }
5336 :
5337 : /* "View.MemoryView":131
5338 : * cdef bint dtype_is_object
5339 : *
5340 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5341 : * mode="c", bint allocate_buffer=True):
5342 : *
5343 : */
5344 :
5345 : /* function exit code */
5346 0 : __pyx_r = 0;
5347 0 : goto __pyx_L0;
5348 0 : __pyx_L1_error:;
5349 0 : __Pyx_XDECREF(__pyx_t_4);
5350 0 : __Pyx_XDECREF(__pyx_t_5);
5351 0 : __Pyx_XDECREF(__pyx_t_6);
5352 0 : __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5353 0 : __pyx_r = -1;
5354 0 : __pyx_L0:;
5355 0 : __Pyx_XDECREF(__pyx_v_format);
5356 0 : __Pyx_RefNannyFinishContext();
5357 0 : return __pyx_r;
5358 : }
5359 :
5360 : /* "View.MemoryView":182
5361 : * _allocate_buffer(self)
5362 : *
5363 : * @cname('getbuffer') # <<<<<<<<<<<<<<
5364 : * def __getbuffer__(self, Py_buffer *info, int flags):
5365 : * cdef int bufmode = -1
5366 : */
5367 :
5368 : /* Python wrapper */
5369 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
5370 0 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5371 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5372 0 : int __pyx_r;
5373 : __Pyx_RefNannyDeclarations
5374 0 : __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5375 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5376 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
5377 :
5378 : /* function exit code */
5379 0 : __Pyx_RefNannyFinishContext();
5380 0 : return __pyx_r;
5381 : }
5382 :
5383 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5384 0 : int __pyx_v_bufmode;
5385 0 : int __pyx_r;
5386 : __Pyx_RefNannyDeclarations
5387 0 : int __pyx_t_1;
5388 0 : char *__pyx_t_2;
5389 0 : Py_ssize_t __pyx_t_3;
5390 0 : int __pyx_t_4;
5391 0 : Py_ssize_t *__pyx_t_5;
5392 0 : int __pyx_lineno = 0;
5393 0 : const char *__pyx_filename = NULL;
5394 0 : int __pyx_clineno = 0;
5395 0 : if (unlikely(__pyx_v_info == NULL)) {
5396 0 : PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
5397 0 : return -1;
5398 : }
5399 0 : __Pyx_RefNannySetupContext("__getbuffer__", 0);
5400 0 : __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5401 0 : __Pyx_GIVEREF(__pyx_v_info->obj);
5402 :
5403 : /* "View.MemoryView":184
5404 : * @cname('getbuffer')
5405 : * def __getbuffer__(self, Py_buffer *info, int flags):
5406 : * cdef int bufmode = -1 # <<<<<<<<<<<<<<
5407 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5408 : * if self.mode == u"c":
5409 : */
5410 0 : __pyx_v_bufmode = -1;
5411 :
5412 : /* "View.MemoryView":185
5413 : * def __getbuffer__(self, Py_buffer *info, int flags):
5414 : * cdef int bufmode = -1
5415 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5416 : * if self.mode == u"c":
5417 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5418 : */
5419 0 : __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
5420 0 : if (__pyx_t_1) {
5421 :
5422 : /* "View.MemoryView":186
5423 : * cdef int bufmode = -1
5424 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5425 : * if self.mode == u"c": # <<<<<<<<<<<<<<
5426 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5427 : * elif self.mode == u"fortran":
5428 : */
5429 0 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 186, __pyx_L1_error)
5430 0 : if (__pyx_t_1) {
5431 :
5432 : /* "View.MemoryView":187
5433 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5434 : * if self.mode == u"c":
5435 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5436 : * elif self.mode == u"fortran":
5437 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5438 : */
5439 0 : __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5440 :
5441 : /* "View.MemoryView":186
5442 : * cdef int bufmode = -1
5443 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5444 : * if self.mode == u"c": # <<<<<<<<<<<<<<
5445 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5446 : * elif self.mode == u"fortran":
5447 : */
5448 0 : goto __pyx_L4;
5449 : }
5450 :
5451 : /* "View.MemoryView":188
5452 : * if self.mode == u"c":
5453 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5454 : * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5455 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5456 : * if not (flags & bufmode):
5457 : */
5458 0 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 188, __pyx_L1_error)
5459 0 : if (__pyx_t_1) {
5460 :
5461 : /* "View.MemoryView":189
5462 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5463 : * elif self.mode == u"fortran":
5464 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5465 : * if not (flags & bufmode):
5466 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5467 : */
5468 0 : __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5469 :
5470 : /* "View.MemoryView":188
5471 : * if self.mode == u"c":
5472 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5473 : * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5474 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5475 : * if not (flags & bufmode):
5476 : */
5477 : }
5478 0 : __pyx_L4:;
5479 :
5480 : /* "View.MemoryView":190
5481 : * elif self.mode == u"fortran":
5482 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5483 : * if not (flags & bufmode): # <<<<<<<<<<<<<<
5484 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5485 : * info.buf = self.data
5486 : */
5487 0 : __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
5488 0 : if (unlikely(__pyx_t_1)) {
5489 :
5490 : /* "View.MemoryView":191
5491 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5492 : * if not (flags & bufmode):
5493 : * raise ValueError, "Can only create a buffer that is contiguous in memory." # <<<<<<<<<<<<<<
5494 : * info.buf = self.data
5495 : * info.len = self.len
5496 : */
5497 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Can_only_create_a_buffer_that_is, 0, 0);
5498 0 : __PYX_ERR(1, 191, __pyx_L1_error)
5499 :
5500 : /* "View.MemoryView":190
5501 : * elif self.mode == u"fortran":
5502 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5503 : * if not (flags & bufmode): # <<<<<<<<<<<<<<
5504 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5505 : * info.buf = self.data
5506 : */
5507 : }
5508 :
5509 : /* "View.MemoryView":185
5510 : * def __getbuffer__(self, Py_buffer *info, int flags):
5511 : * cdef int bufmode = -1
5512 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5513 : * if self.mode == u"c":
5514 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5515 : */
5516 : }
5517 :
5518 : /* "View.MemoryView":192
5519 : * if not (flags & bufmode):
5520 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5521 : * info.buf = self.data # <<<<<<<<<<<<<<
5522 : * info.len = self.len
5523 : *
5524 : */
5525 0 : __pyx_t_2 = __pyx_v_self->data;
5526 0 : __pyx_v_info->buf = __pyx_t_2;
5527 :
5528 : /* "View.MemoryView":193
5529 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5530 : * info.buf = self.data
5531 : * info.len = self.len # <<<<<<<<<<<<<<
5532 : *
5533 : * if flags & PyBUF_STRIDES:
5534 : */
5535 0 : __pyx_t_3 = __pyx_v_self->len;
5536 0 : __pyx_v_info->len = __pyx_t_3;
5537 :
5538 : /* "View.MemoryView":195
5539 : * info.len = self.len
5540 : *
5541 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5542 : * info.ndim = self.ndim
5543 : * info.shape = self._shape
5544 : */
5545 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
5546 0 : if (__pyx_t_1) {
5547 :
5548 : /* "View.MemoryView":196
5549 : *
5550 : * if flags & PyBUF_STRIDES:
5551 : * info.ndim = self.ndim # <<<<<<<<<<<<<<
5552 : * info.shape = self._shape
5553 : * info.strides = self._strides
5554 : */
5555 0 : __pyx_t_4 = __pyx_v_self->ndim;
5556 0 : __pyx_v_info->ndim = __pyx_t_4;
5557 :
5558 : /* "View.MemoryView":197
5559 : * if flags & PyBUF_STRIDES:
5560 : * info.ndim = self.ndim
5561 : * info.shape = self._shape # <<<<<<<<<<<<<<
5562 : * info.strides = self._strides
5563 : * else:
5564 : */
5565 0 : __pyx_t_5 = __pyx_v_self->_shape;
5566 0 : __pyx_v_info->shape = __pyx_t_5;
5567 :
5568 : /* "View.MemoryView":198
5569 : * info.ndim = self.ndim
5570 : * info.shape = self._shape
5571 : * info.strides = self._strides # <<<<<<<<<<<<<<
5572 : * else:
5573 : * info.ndim = 1
5574 : */
5575 0 : __pyx_t_5 = __pyx_v_self->_strides;
5576 0 : __pyx_v_info->strides = __pyx_t_5;
5577 :
5578 : /* "View.MemoryView":195
5579 : * info.len = self.len
5580 : *
5581 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5582 : * info.ndim = self.ndim
5583 : * info.shape = self._shape
5584 : */
5585 0 : goto __pyx_L6;
5586 : }
5587 :
5588 : /* "View.MemoryView":200
5589 : * info.strides = self._strides
5590 : * else:
5591 : * info.ndim = 1 # <<<<<<<<<<<<<<
5592 : * info.shape = &self.len if flags & PyBUF_ND else NULL
5593 : * info.strides = NULL
5594 : */
5595 : /*else*/ {
5596 0 : __pyx_v_info->ndim = 1;
5597 :
5598 : /* "View.MemoryView":201
5599 : * else:
5600 : * info.ndim = 1
5601 : * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
5602 : * info.strides = NULL
5603 : *
5604 : */
5605 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
5606 0 : if (__pyx_t_1) {
5607 : __pyx_t_5 = (&__pyx_v_self->len);
5608 : } else {
5609 : __pyx_t_5 = NULL;
5610 : }
5611 0 : __pyx_v_info->shape = __pyx_t_5;
5612 :
5613 : /* "View.MemoryView":202
5614 : * info.ndim = 1
5615 : * info.shape = &self.len if flags & PyBUF_ND else NULL
5616 : * info.strides = NULL # <<<<<<<<<<<<<<
5617 : *
5618 : * info.suboffsets = NULL
5619 : */
5620 0 : __pyx_v_info->strides = NULL;
5621 : }
5622 0 : __pyx_L6:;
5623 :
5624 : /* "View.MemoryView":204
5625 : * info.strides = NULL
5626 : *
5627 : * info.suboffsets = NULL # <<<<<<<<<<<<<<
5628 : * info.itemsize = self.itemsize
5629 : * info.readonly = 0
5630 : */
5631 0 : __pyx_v_info->suboffsets = NULL;
5632 :
5633 : /* "View.MemoryView":205
5634 : *
5635 : * info.suboffsets = NULL
5636 : * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
5637 : * info.readonly = 0
5638 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
5639 : */
5640 0 : __pyx_t_3 = __pyx_v_self->itemsize;
5641 0 : __pyx_v_info->itemsize = __pyx_t_3;
5642 :
5643 : /* "View.MemoryView":206
5644 : * info.suboffsets = NULL
5645 : * info.itemsize = self.itemsize
5646 : * info.readonly = 0 # <<<<<<<<<<<<<<
5647 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
5648 : * info.obj = self
5649 : */
5650 0 : __pyx_v_info->readonly = 0;
5651 :
5652 : /* "View.MemoryView":207
5653 : * info.itemsize = self.itemsize
5654 : * info.readonly = 0
5655 : * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
5656 : * info.obj = self
5657 : *
5658 : */
5659 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
5660 0 : if (__pyx_t_1) {
5661 0 : __pyx_t_2 = __pyx_v_self->format;
5662 : } else {
5663 : __pyx_t_2 = NULL;
5664 : }
5665 0 : __pyx_v_info->format = __pyx_t_2;
5666 :
5667 : /* "View.MemoryView":208
5668 : * info.readonly = 0
5669 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
5670 : * info.obj = self # <<<<<<<<<<<<<<
5671 : *
5672 : * def __dealloc__(array self):
5673 : */
5674 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
5675 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
5676 0 : __Pyx_GOTREF(__pyx_v_info->obj);
5677 0 : __Pyx_DECREF(__pyx_v_info->obj);
5678 0 : __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5679 :
5680 : /* "View.MemoryView":182
5681 : * _allocate_buffer(self)
5682 : *
5683 : * @cname('getbuffer') # <<<<<<<<<<<<<<
5684 : * def __getbuffer__(self, Py_buffer *info, int flags):
5685 : * cdef int bufmode = -1
5686 : */
5687 :
5688 : /* function exit code */
5689 0 : __pyx_r = 0;
5690 0 : goto __pyx_L0;
5691 0 : __pyx_L1_error:;
5692 0 : __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5693 0 : __pyx_r = -1;
5694 0 : if (__pyx_v_info->obj != NULL) {
5695 0 : __Pyx_GOTREF(__pyx_v_info->obj);
5696 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5697 : }
5698 0 : goto __pyx_L2;
5699 0 : __pyx_L0:;
5700 0 : if (__pyx_v_info->obj == Py_None) {
5701 0 : __Pyx_GOTREF(__pyx_v_info->obj);
5702 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5703 : }
5704 0 : __pyx_L2:;
5705 : __Pyx_RefNannyFinishContext();
5706 : return __pyx_r;
5707 : }
5708 :
5709 : /* "View.MemoryView":210
5710 : * info.obj = self
5711 : *
5712 : * def __dealloc__(array self): # <<<<<<<<<<<<<<
5713 : * if self.callback_free_data != NULL:
5714 : * self.callback_free_data(self.data)
5715 : */
5716 :
5717 : /* Python wrapper */
5718 : static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
5719 0 : static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
5720 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5721 : __Pyx_RefNannyDeclarations
5722 0 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
5723 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5724 0 : __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
5725 :
5726 : /* function exit code */
5727 0 : __Pyx_RefNannyFinishContext();
5728 : }
5729 :
5730 0 : static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
5731 0 : int __pyx_t_1;
5732 0 : int __pyx_t_2;
5733 :
5734 : /* "View.MemoryView":211
5735 : *
5736 : * def __dealloc__(array self):
5737 : * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
5738 : * self.callback_free_data(self.data)
5739 : * elif self.free_data and self.data is not NULL:
5740 : */
5741 0 : __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
5742 0 : if (__pyx_t_1) {
5743 :
5744 : /* "View.MemoryView":212
5745 : * def __dealloc__(array self):
5746 : * if self.callback_free_data != NULL:
5747 : * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
5748 : * elif self.free_data and self.data is not NULL:
5749 : * if self.dtype_is_object:
5750 : */
5751 0 : __pyx_v_self->callback_free_data(__pyx_v_self->data);
5752 :
5753 : /* "View.MemoryView":211
5754 : *
5755 : * def __dealloc__(array self):
5756 : * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
5757 : * self.callback_free_data(self.data)
5758 : * elif self.free_data and self.data is not NULL:
5759 : */
5760 0 : goto __pyx_L3;
5761 : }
5762 :
5763 : /* "View.MemoryView":213
5764 : * if self.callback_free_data != NULL:
5765 : * self.callback_free_data(self.data)
5766 : * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
5767 : * if self.dtype_is_object:
5768 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5769 : */
5770 0 : if (__pyx_v_self->free_data) {
5771 0 : } else {
5772 0 : __pyx_t_1 = __pyx_v_self->free_data;
5773 0 : goto __pyx_L4_bool_binop_done;
5774 : }
5775 0 : __pyx_t_2 = (__pyx_v_self->data != NULL);
5776 0 : __pyx_t_1 = __pyx_t_2;
5777 0 : __pyx_L4_bool_binop_done:;
5778 0 : if (__pyx_t_1) {
5779 :
5780 : /* "View.MemoryView":214
5781 : * self.callback_free_data(self.data)
5782 : * elif self.free_data and self.data is not NULL:
5783 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
5784 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5785 : * free(self.data)
5786 : */
5787 0 : if (__pyx_v_self->dtype_is_object) {
5788 :
5789 : /* "View.MemoryView":215
5790 : * elif self.free_data and self.data is not NULL:
5791 : * if self.dtype_is_object:
5792 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<<
5793 : * free(self.data)
5794 : * PyObject_Free(self._shape)
5795 : */
5796 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
5797 :
5798 : /* "View.MemoryView":214
5799 : * self.callback_free_data(self.data)
5800 : * elif self.free_data and self.data is not NULL:
5801 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
5802 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5803 : * free(self.data)
5804 : */
5805 : }
5806 :
5807 : /* "View.MemoryView":216
5808 : * if self.dtype_is_object:
5809 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5810 : * free(self.data) # <<<<<<<<<<<<<<
5811 : * PyObject_Free(self._shape)
5812 : *
5813 : */
5814 0 : free(__pyx_v_self->data);
5815 :
5816 : /* "View.MemoryView":213
5817 : * if self.callback_free_data != NULL:
5818 : * self.callback_free_data(self.data)
5819 : * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
5820 : * if self.dtype_is_object:
5821 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5822 : */
5823 : }
5824 0 : __pyx_L3:;
5825 :
5826 : /* "View.MemoryView":217
5827 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5828 : * free(self.data)
5829 : * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
5830 : *
5831 : * @property
5832 : */
5833 0 : PyObject_Free(__pyx_v_self->_shape);
5834 :
5835 : /* "View.MemoryView":210
5836 : * info.obj = self
5837 : *
5838 : * def __dealloc__(array self): # <<<<<<<<<<<<<<
5839 : * if self.callback_free_data != NULL:
5840 : * self.callback_free_data(self.data)
5841 : */
5842 :
5843 : /* function exit code */
5844 0 : }
5845 :
5846 : /* "View.MemoryView":219
5847 : * PyObject_Free(self._shape)
5848 : *
5849 : * @property # <<<<<<<<<<<<<<
5850 : * def memview(self):
5851 : * return self.get_memview()
5852 : */
5853 :
5854 : /* Python wrapper */
5855 : static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
5856 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
5857 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5858 0 : PyObject *__pyx_r = 0;
5859 : __Pyx_RefNannyDeclarations
5860 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5861 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5862 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
5863 :
5864 : /* function exit code */
5865 0 : __Pyx_RefNannyFinishContext();
5866 0 : return __pyx_r;
5867 : }
5868 :
5869 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
5870 0 : PyObject *__pyx_r = NULL;
5871 : __Pyx_RefNannyDeclarations
5872 0 : PyObject *__pyx_t_1 = NULL;
5873 0 : int __pyx_lineno = 0;
5874 0 : const char *__pyx_filename = NULL;
5875 0 : int __pyx_clineno = 0;
5876 0 : __Pyx_RefNannySetupContext("__get__", 1);
5877 :
5878 : /* "View.MemoryView":221
5879 : * @property
5880 : * def memview(self):
5881 : * return self.get_memview() # <<<<<<<<<<<<<<
5882 : *
5883 : * @cname('get_memview')
5884 : */
5885 0 : __Pyx_XDECREF(__pyx_r);
5886 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
5887 0 : __Pyx_GOTREF(__pyx_t_1);
5888 0 : __pyx_r = __pyx_t_1;
5889 0 : __pyx_t_1 = 0;
5890 0 : goto __pyx_L0;
5891 :
5892 : /* "View.MemoryView":219
5893 : * PyObject_Free(self._shape)
5894 : *
5895 : * @property # <<<<<<<<<<<<<<
5896 : * def memview(self):
5897 : * return self.get_memview()
5898 : */
5899 :
5900 : /* function exit code */
5901 0 : __pyx_L1_error:;
5902 0 : __Pyx_XDECREF(__pyx_t_1);
5903 0 : __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5904 0 : __pyx_r = NULL;
5905 0 : __pyx_L0:;
5906 0 : __Pyx_XGIVEREF(__pyx_r);
5907 0 : __Pyx_RefNannyFinishContext();
5908 0 : return __pyx_r;
5909 : }
5910 :
5911 : /* "View.MemoryView":224
5912 : *
5913 : * @cname('get_memview')
5914 : * cdef get_memview(self): # <<<<<<<<<<<<<<
5915 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5916 : * return memoryview(self, flags, self.dtype_is_object)
5917 : */
5918 :
5919 0 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
5920 0 : int __pyx_v_flags;
5921 0 : PyObject *__pyx_r = NULL;
5922 : __Pyx_RefNannyDeclarations
5923 0 : PyObject *__pyx_t_1 = NULL;
5924 0 : PyObject *__pyx_t_2 = NULL;
5925 0 : PyObject *__pyx_t_3 = NULL;
5926 0 : int __pyx_lineno = 0;
5927 0 : const char *__pyx_filename = NULL;
5928 0 : int __pyx_clineno = 0;
5929 0 : __Pyx_RefNannySetupContext("get_memview", 1);
5930 :
5931 : /* "View.MemoryView":225
5932 : * @cname('get_memview')
5933 : * cdef get_memview(self):
5934 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
5935 : * return memoryview(self, flags, self.dtype_is_object)
5936 : *
5937 : */
5938 0 : __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
5939 :
5940 : /* "View.MemoryView":226
5941 : * cdef get_memview(self):
5942 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5943 : * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
5944 : *
5945 : * def __len__(self):
5946 : */
5947 0 : __Pyx_XDECREF(__pyx_r);
5948 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error)
5949 0 : __Pyx_GOTREF(__pyx_t_1);
5950 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
5951 0 : __Pyx_GOTREF(__pyx_t_2);
5952 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error)
5953 0 : __Pyx_GOTREF(__pyx_t_3);
5954 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
5955 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
5956 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(1, 226, __pyx_L1_error);
5957 0 : __Pyx_GIVEREF(__pyx_t_1);
5958 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error);
5959 0 : __Pyx_GIVEREF(__pyx_t_2);
5960 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error);
5961 0 : __pyx_t_1 = 0;
5962 0 : __pyx_t_2 = 0;
5963 0 : __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
5964 0 : __Pyx_GOTREF(__pyx_t_2);
5965 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5966 0 : __pyx_r = __pyx_t_2;
5967 0 : __pyx_t_2 = 0;
5968 0 : goto __pyx_L0;
5969 :
5970 : /* "View.MemoryView":224
5971 : *
5972 : * @cname('get_memview')
5973 : * cdef get_memview(self): # <<<<<<<<<<<<<<
5974 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5975 : * return memoryview(self, flags, self.dtype_is_object)
5976 : */
5977 :
5978 : /* function exit code */
5979 0 : __pyx_L1_error:;
5980 0 : __Pyx_XDECREF(__pyx_t_1);
5981 0 : __Pyx_XDECREF(__pyx_t_2);
5982 0 : __Pyx_XDECREF(__pyx_t_3);
5983 0 : __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
5984 0 : __pyx_r = 0;
5985 0 : __pyx_L0:;
5986 0 : __Pyx_XGIVEREF(__pyx_r);
5987 0 : __Pyx_RefNannyFinishContext();
5988 0 : return __pyx_r;
5989 : }
5990 :
5991 : /* "View.MemoryView":228
5992 : * return memoryview(self, flags, self.dtype_is_object)
5993 : *
5994 : * def __len__(self): # <<<<<<<<<<<<<<
5995 : * return self._shape[0]
5996 : *
5997 : */
5998 :
5999 : /* Python wrapper */
6000 : static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
6001 0 : static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
6002 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6003 0 : Py_ssize_t __pyx_r;
6004 : __Pyx_RefNannyDeclarations
6005 0 : __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
6006 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6007 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
6008 :
6009 : /* function exit code */
6010 0 : __Pyx_RefNannyFinishContext();
6011 0 : return __pyx_r;
6012 : }
6013 :
6014 0 : static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
6015 0 : Py_ssize_t __pyx_r;
6016 :
6017 : /* "View.MemoryView":229
6018 : *
6019 : * def __len__(self):
6020 : * return self._shape[0] # <<<<<<<<<<<<<<
6021 : *
6022 : * def __getattr__(self, attr):
6023 : */
6024 0 : __pyx_r = (__pyx_v_self->_shape[0]);
6025 0 : goto __pyx_L0;
6026 :
6027 : /* "View.MemoryView":228
6028 : * return memoryview(self, flags, self.dtype_is_object)
6029 : *
6030 : * def __len__(self): # <<<<<<<<<<<<<<
6031 : * return self._shape[0]
6032 : *
6033 : */
6034 :
6035 : /* function exit code */
6036 0 : __pyx_L0:;
6037 0 : return __pyx_r;
6038 : }
6039 :
6040 : /* "View.MemoryView":231
6041 : * return self._shape[0]
6042 : *
6043 : * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6044 : * return getattr(self.memview, attr)
6045 : *
6046 : */
6047 :
6048 : /* Python wrapper */
6049 : static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
6050 0 : static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
6051 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6052 0 : PyObject *__pyx_r = 0;
6053 : __Pyx_RefNannyDeclarations
6054 0 : __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
6055 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6056 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
6057 :
6058 : /* function exit code */
6059 0 : __Pyx_RefNannyFinishContext();
6060 0 : return __pyx_r;
6061 : }
6062 :
6063 0 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
6064 0 : PyObject *__pyx_r = NULL;
6065 : __Pyx_RefNannyDeclarations
6066 0 : PyObject *__pyx_t_1 = NULL;
6067 0 : PyObject *__pyx_t_2 = NULL;
6068 0 : int __pyx_lineno = 0;
6069 0 : const char *__pyx_filename = NULL;
6070 0 : int __pyx_clineno = 0;
6071 0 : __Pyx_RefNannySetupContext("__getattr__", 1);
6072 :
6073 : /* "View.MemoryView":232
6074 : *
6075 : * def __getattr__(self, attr):
6076 : * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
6077 : *
6078 : * def __getitem__(self, item):
6079 : */
6080 0 : __Pyx_XDECREF(__pyx_r);
6081 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 232, __pyx_L1_error)
6082 0 : __Pyx_GOTREF(__pyx_t_1);
6083 0 : __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 232, __pyx_L1_error)
6084 0 : __Pyx_GOTREF(__pyx_t_2);
6085 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6086 0 : __pyx_r = __pyx_t_2;
6087 0 : __pyx_t_2 = 0;
6088 0 : goto __pyx_L0;
6089 :
6090 : /* "View.MemoryView":231
6091 : * return self._shape[0]
6092 : *
6093 : * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6094 : * return getattr(self.memview, attr)
6095 : *
6096 : */
6097 :
6098 : /* function exit code */
6099 0 : __pyx_L1_error:;
6100 0 : __Pyx_XDECREF(__pyx_t_1);
6101 0 : __Pyx_XDECREF(__pyx_t_2);
6102 0 : __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6103 0 : __pyx_r = NULL;
6104 0 : __pyx_L0:;
6105 0 : __Pyx_XGIVEREF(__pyx_r);
6106 0 : __Pyx_RefNannyFinishContext();
6107 0 : return __pyx_r;
6108 : }
6109 :
6110 : /* "View.MemoryView":234
6111 : * return getattr(self.memview, attr)
6112 : *
6113 : * def __getitem__(self, item): # <<<<<<<<<<<<<<
6114 : * return self.memview[item]
6115 : *
6116 : */
6117 :
6118 : /* Python wrapper */
6119 : static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
6120 0 : static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
6121 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6122 0 : PyObject *__pyx_r = 0;
6123 : __Pyx_RefNannyDeclarations
6124 0 : __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
6125 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6126 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
6127 :
6128 : /* function exit code */
6129 0 : __Pyx_RefNannyFinishContext();
6130 0 : return __pyx_r;
6131 : }
6132 :
6133 0 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
6134 0 : PyObject *__pyx_r = NULL;
6135 : __Pyx_RefNannyDeclarations
6136 0 : PyObject *__pyx_t_1 = NULL;
6137 0 : PyObject *__pyx_t_2 = NULL;
6138 0 : int __pyx_lineno = 0;
6139 0 : const char *__pyx_filename = NULL;
6140 0 : int __pyx_clineno = 0;
6141 0 : __Pyx_RefNannySetupContext("__getitem__", 1);
6142 :
6143 : /* "View.MemoryView":235
6144 : *
6145 : * def __getitem__(self, item):
6146 : * return self.memview[item] # <<<<<<<<<<<<<<
6147 : *
6148 : * def __setitem__(self, item, value):
6149 : */
6150 0 : __Pyx_XDECREF(__pyx_r);
6151 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
6152 0 : __Pyx_GOTREF(__pyx_t_1);
6153 0 : __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
6154 0 : __Pyx_GOTREF(__pyx_t_2);
6155 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6156 0 : __pyx_r = __pyx_t_2;
6157 0 : __pyx_t_2 = 0;
6158 0 : goto __pyx_L0;
6159 :
6160 : /* "View.MemoryView":234
6161 : * return getattr(self.memview, attr)
6162 : *
6163 : * def __getitem__(self, item): # <<<<<<<<<<<<<<
6164 : * return self.memview[item]
6165 : *
6166 : */
6167 :
6168 : /* function exit code */
6169 0 : __pyx_L1_error:;
6170 0 : __Pyx_XDECREF(__pyx_t_1);
6171 0 : __Pyx_XDECREF(__pyx_t_2);
6172 0 : __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6173 0 : __pyx_r = NULL;
6174 0 : __pyx_L0:;
6175 0 : __Pyx_XGIVEREF(__pyx_r);
6176 0 : __Pyx_RefNannyFinishContext();
6177 0 : return __pyx_r;
6178 : }
6179 :
6180 : /* "View.MemoryView":237
6181 : * return self.memview[item]
6182 : *
6183 : * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6184 : * self.memview[item] = value
6185 : *
6186 : */
6187 :
6188 : /* Python wrapper */
6189 : static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
6190 0 : static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6191 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6192 0 : int __pyx_r;
6193 : __Pyx_RefNannyDeclarations
6194 0 : __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
6195 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6196 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
6197 :
6198 : /* function exit code */
6199 0 : __Pyx_RefNannyFinishContext();
6200 0 : return __pyx_r;
6201 : }
6202 :
6203 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6204 0 : int __pyx_r;
6205 : __Pyx_RefNannyDeclarations
6206 0 : PyObject *__pyx_t_1 = NULL;
6207 0 : int __pyx_lineno = 0;
6208 0 : const char *__pyx_filename = NULL;
6209 0 : int __pyx_clineno = 0;
6210 0 : __Pyx_RefNannySetupContext("__setitem__", 1);
6211 :
6212 : /* "View.MemoryView":238
6213 : *
6214 : * def __setitem__(self, item, value):
6215 : * self.memview[item] = value # <<<<<<<<<<<<<<
6216 : *
6217 : *
6218 : */
6219 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
6220 0 : __Pyx_GOTREF(__pyx_t_1);
6221 0 : if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 238, __pyx_L1_error)
6222 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6223 :
6224 : /* "View.MemoryView":237
6225 : * return self.memview[item]
6226 : *
6227 : * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6228 : * self.memview[item] = value
6229 : *
6230 : */
6231 :
6232 : /* function exit code */
6233 0 : __pyx_r = 0;
6234 0 : goto __pyx_L0;
6235 0 : __pyx_L1_error:;
6236 0 : __Pyx_XDECREF(__pyx_t_1);
6237 0 : __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6238 0 : __pyx_r = -1;
6239 0 : __pyx_L0:;
6240 0 : __Pyx_RefNannyFinishContext();
6241 0 : return __pyx_r;
6242 : }
6243 :
6244 : /* "(tree fragment)":1
6245 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6246 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6247 : * def __setstate_cython__(self, __pyx_state):
6248 : */
6249 :
6250 : /* Python wrapper */
6251 : static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6252 : #if CYTHON_METH_FASTCALL
6253 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6254 : #else
6255 : PyObject *__pyx_args, PyObject *__pyx_kwds
6256 : #endif
6257 : ); /*proto*/
6258 0 : static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6259 : #if CYTHON_METH_FASTCALL
6260 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6261 : #else
6262 : PyObject *__pyx_args, PyObject *__pyx_kwds
6263 : #endif
6264 : ) {
6265 : #if !CYTHON_METH_FASTCALL
6266 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6267 : #endif
6268 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6269 0 : PyObject *__pyx_r = 0;
6270 : __Pyx_RefNannyDeclarations
6271 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6272 : #if !CYTHON_METH_FASTCALL
6273 : #if CYTHON_ASSUME_SAFE_MACROS
6274 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6275 : #else
6276 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6277 : #endif
6278 : #endif
6279 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6280 0 : if (unlikely(__pyx_nargs > 0)) {
6281 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
6282 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
6283 0 : __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
6284 :
6285 : /* function exit code */
6286 0 : __Pyx_RefNannyFinishContext();
6287 0 : return __pyx_r;
6288 : }
6289 :
6290 0 : static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
6291 0 : PyObject *__pyx_r = NULL;
6292 : __Pyx_RefNannyDeclarations
6293 0 : int __pyx_lineno = 0;
6294 0 : const char *__pyx_filename = NULL;
6295 0 : int __pyx_clineno = 0;
6296 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
6297 :
6298 : /* "(tree fragment)":2
6299 : * def __reduce_cython__(self):
6300 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6301 : * def __setstate_cython__(self, __pyx_state):
6302 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6303 : */
6304 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
6305 0 : __PYX_ERR(1, 2, __pyx_L1_error)
6306 :
6307 : /* "(tree fragment)":1
6308 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6309 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6310 : * def __setstate_cython__(self, __pyx_state):
6311 : */
6312 :
6313 : /* function exit code */
6314 0 : __pyx_L1_error:;
6315 0 : __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6316 0 : __pyx_r = NULL;
6317 0 : __Pyx_XGIVEREF(__pyx_r);
6318 0 : __Pyx_RefNannyFinishContext();
6319 0 : return __pyx_r;
6320 : }
6321 :
6322 : /* "(tree fragment)":3
6323 : * def __reduce_cython__(self):
6324 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6325 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6326 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6327 : */
6328 :
6329 : /* Python wrapper */
6330 : static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6331 : #if CYTHON_METH_FASTCALL
6332 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6333 : #else
6334 : PyObject *__pyx_args, PyObject *__pyx_kwds
6335 : #endif
6336 : ); /*proto*/
6337 0 : static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6338 : #if CYTHON_METH_FASTCALL
6339 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6340 : #else
6341 : PyObject *__pyx_args, PyObject *__pyx_kwds
6342 : #endif
6343 : ) {
6344 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
6345 : #if !CYTHON_METH_FASTCALL
6346 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6347 : #endif
6348 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6349 0 : PyObject* values[1] = {0};
6350 0 : int __pyx_lineno = 0;
6351 0 : const char *__pyx_filename = NULL;
6352 0 : int __pyx_clineno = 0;
6353 0 : PyObject *__pyx_r = 0;
6354 : __Pyx_RefNannyDeclarations
6355 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6356 : #if !CYTHON_METH_FASTCALL
6357 : #if CYTHON_ASSUME_SAFE_MACROS
6358 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6359 : #else
6360 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6361 : #endif
6362 : #endif
6363 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6364 : {
6365 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
6366 0 : if (__pyx_kwds) {
6367 0 : Py_ssize_t kw_args;
6368 0 : switch (__pyx_nargs) {
6369 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
6370 0 : CYTHON_FALLTHROUGH;
6371 0 : case 0: break;
6372 0 : default: goto __pyx_L5_argtuple_error;
6373 : }
6374 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
6375 0 : switch (__pyx_nargs) {
6376 : case 0:
6377 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
6378 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
6379 0 : kw_args--;
6380 : }
6381 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
6382 0 : else goto __pyx_L5_argtuple_error;
6383 : }
6384 0 : if (unlikely(kw_args > 0)) {
6385 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
6386 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
6387 : }
6388 0 : } else if (unlikely(__pyx_nargs != 1)) {
6389 0 : goto __pyx_L5_argtuple_error;
6390 : } else {
6391 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
6392 : }
6393 0 : __pyx_v___pyx_state = values[0];
6394 : }
6395 0 : goto __pyx_L6_skip;
6396 0 : __pyx_L5_argtuple_error:;
6397 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
6398 0 : __pyx_L6_skip:;
6399 0 : goto __pyx_L4_argument_unpacking_done;
6400 0 : __pyx_L3_error:;
6401 : {
6402 0 : Py_ssize_t __pyx_temp;
6403 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6404 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
6405 : }
6406 : }
6407 0 : __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6408 0 : __Pyx_RefNannyFinishContext();
6409 0 : return NULL;
6410 0 : __pyx_L4_argument_unpacking_done:;
6411 0 : __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
6412 :
6413 : /* function exit code */
6414 : {
6415 0 : Py_ssize_t __pyx_temp;
6416 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6417 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
6418 : }
6419 : }
6420 : __Pyx_RefNannyFinishContext();
6421 : return __pyx_r;
6422 : }
6423 :
6424 0 : static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6425 0 : PyObject *__pyx_r = NULL;
6426 : __Pyx_RefNannyDeclarations
6427 0 : int __pyx_lineno = 0;
6428 0 : const char *__pyx_filename = NULL;
6429 0 : int __pyx_clineno = 0;
6430 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
6431 :
6432 : /* "(tree fragment)":4
6433 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6434 : * def __setstate_cython__(self, __pyx_state):
6435 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6436 : */
6437 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
6438 0 : __PYX_ERR(1, 4, __pyx_L1_error)
6439 :
6440 : /* "(tree fragment)":3
6441 : * def __reduce_cython__(self):
6442 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6443 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6444 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6445 : */
6446 :
6447 : /* function exit code */
6448 0 : __pyx_L1_error:;
6449 0 : __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6450 0 : __pyx_r = NULL;
6451 0 : __Pyx_XGIVEREF(__pyx_r);
6452 0 : __Pyx_RefNannyFinishContext();
6453 0 : return __pyx_r;
6454 : }
6455 :
6456 : /* "View.MemoryView":248
6457 : *
6458 : * @cname("__pyx_array_allocate_buffer")
6459 : * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
6460 : *
6461 : *
6462 : */
6463 :
6464 0 : static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
6465 0 : Py_ssize_t __pyx_v_i;
6466 0 : PyObject **__pyx_v_p;
6467 0 : int __pyx_r;
6468 0 : int __pyx_t_1;
6469 0 : Py_ssize_t __pyx_t_2;
6470 0 : Py_ssize_t __pyx_t_3;
6471 0 : Py_ssize_t __pyx_t_4;
6472 0 : int __pyx_lineno = 0;
6473 0 : const char *__pyx_filename = NULL;
6474 0 : int __pyx_clineno = 0;
6475 :
6476 : /* "View.MemoryView":254
6477 : * cdef PyObject **p
6478 : *
6479 : * self.free_data = True # <<<<<<<<<<<<<<
6480 : * self.data = <char *>malloc(self.len)
6481 : * if not self.data:
6482 : */
6483 0 : __pyx_v_self->free_data = 1;
6484 :
6485 : /* "View.MemoryView":255
6486 : *
6487 : * self.free_data = True
6488 : * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
6489 : * if not self.data:
6490 : * raise MemoryError, "unable to allocate array data."
6491 : */
6492 0 : __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
6493 :
6494 : /* "View.MemoryView":256
6495 : * self.free_data = True
6496 : * self.data = <char *>malloc(self.len)
6497 : * if not self.data: # <<<<<<<<<<<<<<
6498 : * raise MemoryError, "unable to allocate array data."
6499 : *
6500 : */
6501 0 : __pyx_t_1 = (!(__pyx_v_self->data != 0));
6502 0 : if (unlikely(__pyx_t_1)) {
6503 :
6504 : /* "View.MemoryView":257
6505 : * self.data = <char *>malloc(self.len)
6506 : * if not self.data:
6507 : * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
6508 : *
6509 : * if self.dtype_is_object:
6510 : */
6511 0 : __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_array_data, 0, 0);
6512 0 : __PYX_ERR(1, 257, __pyx_L1_error)
6513 :
6514 : /* "View.MemoryView":256
6515 : * self.free_data = True
6516 : * self.data = <char *>malloc(self.len)
6517 : * if not self.data: # <<<<<<<<<<<<<<
6518 : * raise MemoryError, "unable to allocate array data."
6519 : *
6520 : */
6521 : }
6522 :
6523 : /* "View.MemoryView":259
6524 : * raise MemoryError, "unable to allocate array data."
6525 : *
6526 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6527 : * p = <PyObject **> self.data
6528 : * for i in range(self.len // self.itemsize):
6529 : */
6530 0 : if (__pyx_v_self->dtype_is_object) {
6531 :
6532 : /* "View.MemoryView":260
6533 : *
6534 : * if self.dtype_is_object:
6535 : * p = <PyObject **> self.data # <<<<<<<<<<<<<<
6536 : * for i in range(self.len // self.itemsize):
6537 : * p[i] = Py_None
6538 : */
6539 0 : __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6540 :
6541 : /* "View.MemoryView":261
6542 : * if self.dtype_is_object:
6543 : * p = <PyObject **> self.data
6544 : * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
6545 : * p[i] = Py_None
6546 : * Py_INCREF(Py_None)
6547 : */
6548 0 : if (unlikely(__pyx_v_self->itemsize == 0)) {
6549 0 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6550 0 : __PYX_ERR(1, 261, __pyx_L1_error)
6551 : }
6552 0 : else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
6553 0 : PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
6554 0 : __PYX_ERR(1, 261, __pyx_L1_error)
6555 : }
6556 0 : __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize);
6557 0 : __pyx_t_3 = __pyx_t_2;
6558 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6559 0 : __pyx_v_i = __pyx_t_4;
6560 :
6561 : /* "View.MemoryView":262
6562 : * p = <PyObject **> self.data
6563 : * for i in range(self.len // self.itemsize):
6564 : * p[i] = Py_None # <<<<<<<<<<<<<<
6565 : * Py_INCREF(Py_None)
6566 : * return 0
6567 : */
6568 0 : (__pyx_v_p[__pyx_v_i]) = Py_None;
6569 :
6570 : /* "View.MemoryView":263
6571 : * for i in range(self.len // self.itemsize):
6572 : * p[i] = Py_None
6573 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
6574 : * return 0
6575 : *
6576 : */
6577 0 : Py_INCREF(Py_None);
6578 : }
6579 :
6580 : /* "View.MemoryView":259
6581 : * raise MemoryError, "unable to allocate array data."
6582 : *
6583 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6584 : * p = <PyObject **> self.data
6585 : * for i in range(self.len // self.itemsize):
6586 : */
6587 : }
6588 :
6589 : /* "View.MemoryView":264
6590 : * p[i] = Py_None
6591 : * Py_INCREF(Py_None)
6592 : * return 0 # <<<<<<<<<<<<<<
6593 : *
6594 : *
6595 : */
6596 0 : __pyx_r = 0;
6597 0 : goto __pyx_L0;
6598 :
6599 : /* "View.MemoryView":248
6600 : *
6601 : * @cname("__pyx_array_allocate_buffer")
6602 : * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
6603 : *
6604 : *
6605 : */
6606 :
6607 : /* function exit code */
6608 0 : __pyx_L1_error:;
6609 0 : __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
6610 0 : __pyx_r = -1;
6611 0 : __pyx_L0:;
6612 0 : return __pyx_r;
6613 : }
6614 :
6615 : /* "View.MemoryView":268
6616 : *
6617 : * @cname("__pyx_array_new")
6618 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
6619 : * cdef array result
6620 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6621 : */
6622 :
6623 0 : static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_c_mode, char *__pyx_v_buf) {
6624 0 : struct __pyx_array_obj *__pyx_v_result = 0;
6625 0 : PyObject *__pyx_v_mode = 0;
6626 0 : struct __pyx_array_obj *__pyx_r = NULL;
6627 : __Pyx_RefNannyDeclarations
6628 0 : PyObject *__pyx_t_1 = NULL;
6629 0 : int __pyx_t_2;
6630 0 : PyObject *__pyx_t_3 = NULL;
6631 0 : PyObject *__pyx_t_4 = NULL;
6632 0 : int __pyx_lineno = 0;
6633 0 : const char *__pyx_filename = NULL;
6634 0 : int __pyx_clineno = 0;
6635 0 : __Pyx_RefNannySetupContext("array_cwrapper", 1);
6636 :
6637 : /* "View.MemoryView":270
6638 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf):
6639 : * cdef array result
6640 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
6641 : *
6642 : * if buf is NULL:
6643 : */
6644 0 : __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
6645 0 : if (__pyx_t_2) {
6646 0 : __Pyx_INCREF(__pyx_n_s_fortran);
6647 : __pyx_t_1 = __pyx_n_s_fortran;
6648 : } else {
6649 0 : __Pyx_INCREF(__pyx_n_s_c);
6650 : __pyx_t_1 = __pyx_n_s_c;
6651 : }
6652 0 : __pyx_v_mode = ((PyObject*)__pyx_t_1);
6653 0 : __pyx_t_1 = 0;
6654 :
6655 : /* "View.MemoryView":272
6656 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6657 : *
6658 : * if buf is NULL: # <<<<<<<<<<<<<<
6659 : * result = array.__new__(array, shape, itemsize, format, mode)
6660 : * else:
6661 : */
6662 0 : __pyx_t_2 = (__pyx_v_buf == NULL);
6663 0 : if (__pyx_t_2) {
6664 :
6665 : /* "View.MemoryView":273
6666 : *
6667 : * if buf is NULL:
6668 : * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
6669 : * else:
6670 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6671 : */
6672 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error)
6673 0 : __Pyx_GOTREF(__pyx_t_1);
6674 0 : __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
6675 0 : __Pyx_GOTREF(__pyx_t_3);
6676 0 : __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 273, __pyx_L1_error)
6677 0 : __Pyx_GOTREF(__pyx_t_4);
6678 0 : __Pyx_INCREF(__pyx_v_shape);
6679 0 : __Pyx_GIVEREF(__pyx_v_shape);
6680 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape)) __PYX_ERR(1, 273, __pyx_L1_error);
6681 0 : __Pyx_GIVEREF(__pyx_t_1);
6682 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error);
6683 0 : __Pyx_GIVEREF(__pyx_t_3);
6684 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error);
6685 0 : __Pyx_INCREF(__pyx_v_mode);
6686 0 : __Pyx_GIVEREF(__pyx_v_mode);
6687 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode)) __PYX_ERR(1, 273, __pyx_L1_error);
6688 0 : __pyx_t_1 = 0;
6689 0 : __pyx_t_3 = 0;
6690 0 : __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
6691 0 : __Pyx_GOTREF((PyObject *)__pyx_t_3);
6692 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6693 0 : __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
6694 0 : __pyx_t_3 = 0;
6695 :
6696 : /* "View.MemoryView":272
6697 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6698 : *
6699 : * if buf is NULL: # <<<<<<<<<<<<<<
6700 : * result = array.__new__(array, shape, itemsize, format, mode)
6701 : * else:
6702 : */
6703 0 : goto __pyx_L3;
6704 : }
6705 :
6706 : /* "View.MemoryView":275
6707 : * result = array.__new__(array, shape, itemsize, format, mode)
6708 : * else:
6709 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
6710 : * result.data = buf
6711 : *
6712 : */
6713 : /*else*/ {
6714 0 : __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
6715 0 : __Pyx_GOTREF(__pyx_t_3);
6716 0 : __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
6717 0 : __Pyx_GOTREF(__pyx_t_4);
6718 0 : __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error)
6719 0 : __Pyx_GOTREF(__pyx_t_1);
6720 0 : __Pyx_INCREF(__pyx_v_shape);
6721 0 : __Pyx_GIVEREF(__pyx_v_shape);
6722 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape)) __PYX_ERR(1, 275, __pyx_L1_error);
6723 0 : __Pyx_GIVEREF(__pyx_t_3);
6724 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error);
6725 0 : __Pyx_GIVEREF(__pyx_t_4);
6726 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error);
6727 0 : __Pyx_INCREF(__pyx_v_mode);
6728 0 : __Pyx_GIVEREF(__pyx_v_mode);
6729 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode)) __PYX_ERR(1, 275, __pyx_L1_error);
6730 0 : __pyx_t_3 = 0;
6731 0 : __pyx_t_4 = 0;
6732 0 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
6733 0 : __Pyx_GOTREF(__pyx_t_4);
6734 0 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
6735 0 : __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
6736 0 : __Pyx_GOTREF((PyObject *)__pyx_t_3);
6737 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6738 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6739 0 : __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
6740 0 : __pyx_t_3 = 0;
6741 :
6742 : /* "View.MemoryView":276
6743 : * else:
6744 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6745 : * result.data = buf # <<<<<<<<<<<<<<
6746 : *
6747 : * return result
6748 : */
6749 0 : __pyx_v_result->data = __pyx_v_buf;
6750 : }
6751 0 : __pyx_L3:;
6752 :
6753 : /* "View.MemoryView":278
6754 : * result.data = buf
6755 : *
6756 : * return result # <<<<<<<<<<<<<<
6757 : *
6758 : *
6759 : */
6760 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
6761 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
6762 0 : __pyx_r = __pyx_v_result;
6763 0 : goto __pyx_L0;
6764 :
6765 : /* "View.MemoryView":268
6766 : *
6767 : * @cname("__pyx_array_new")
6768 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
6769 : * cdef array result
6770 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6771 : */
6772 :
6773 : /* function exit code */
6774 0 : __pyx_L1_error:;
6775 0 : __Pyx_XDECREF(__pyx_t_1);
6776 0 : __Pyx_XDECREF(__pyx_t_3);
6777 0 : __Pyx_XDECREF(__pyx_t_4);
6778 0 : __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
6779 0 : __pyx_r = 0;
6780 0 : __pyx_L0:;
6781 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
6782 0 : __Pyx_XDECREF(__pyx_v_mode);
6783 0 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
6784 0 : __Pyx_RefNannyFinishContext();
6785 0 : return __pyx_r;
6786 : }
6787 :
6788 : /* "View.MemoryView":304
6789 : * cdef class Enum(object):
6790 : * cdef object name
6791 : * def __init__(self, name): # <<<<<<<<<<<<<<
6792 : * self.name = name
6793 : * def __repr__(self):
6794 : */
6795 :
6796 : /* Python wrapper */
6797 : static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6798 5 : static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6799 5 : PyObject *__pyx_v_name = 0;
6800 5 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6801 5 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6802 5 : PyObject* values[1] = {0};
6803 5 : int __pyx_lineno = 0;
6804 5 : const char *__pyx_filename = NULL;
6805 5 : int __pyx_clineno = 0;
6806 5 : int __pyx_r;
6807 : __Pyx_RefNannyDeclarations
6808 5 : __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
6809 : #if CYTHON_ASSUME_SAFE_MACROS
6810 5 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6811 : #else
6812 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
6813 : #endif
6814 5 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6815 : {
6816 5 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
6817 5 : if (__pyx_kwds) {
6818 0 : Py_ssize_t kw_args;
6819 0 : switch (__pyx_nargs) {
6820 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
6821 0 : CYTHON_FALLTHROUGH;
6822 0 : case 0: break;
6823 0 : default: goto __pyx_L5_argtuple_error;
6824 : }
6825 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
6826 0 : switch (__pyx_nargs) {
6827 0 : case 0:
6828 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
6829 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
6830 0 : kw_args--;
6831 : }
6832 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 304, __pyx_L3_error)
6833 0 : else goto __pyx_L5_argtuple_error;
6834 : }
6835 0 : if (unlikely(kw_args > 0)) {
6836 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
6837 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 304, __pyx_L3_error)
6838 : }
6839 5 : } else if (unlikely(__pyx_nargs != 1)) {
6840 0 : goto __pyx_L5_argtuple_error;
6841 : } else {
6842 5 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
6843 : }
6844 5 : __pyx_v_name = values[0];
6845 : }
6846 5 : goto __pyx_L6_skip;
6847 0 : __pyx_L5_argtuple_error:;
6848 0 : __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 304, __pyx_L3_error)
6849 5 : __pyx_L6_skip:;
6850 5 : goto __pyx_L4_argument_unpacking_done;
6851 0 : __pyx_L3_error:;
6852 : {
6853 0 : Py_ssize_t __pyx_temp;
6854 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6855 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
6856 : }
6857 : }
6858 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6859 0 : __Pyx_RefNannyFinishContext();
6860 0 : return -1;
6861 5 : __pyx_L4_argument_unpacking_done:;
6862 5 : __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
6863 :
6864 : /* function exit code */
6865 : {
6866 5 : Py_ssize_t __pyx_temp;
6867 5 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6868 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
6869 : }
6870 : }
6871 : __Pyx_RefNannyFinishContext();
6872 : return __pyx_r;
6873 : }
6874 :
6875 5 : static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
6876 5 : int __pyx_r;
6877 : __Pyx_RefNannyDeclarations
6878 5 : __Pyx_RefNannySetupContext("__init__", 1);
6879 :
6880 : /* "View.MemoryView":305
6881 : * cdef object name
6882 : * def __init__(self, name):
6883 : * self.name = name # <<<<<<<<<<<<<<
6884 : * def __repr__(self):
6885 : * return self.name
6886 : */
6887 5 : __Pyx_INCREF(__pyx_v_name);
6888 5 : __Pyx_GIVEREF(__pyx_v_name);
6889 5 : __Pyx_GOTREF(__pyx_v_self->name);
6890 5 : __Pyx_DECREF(__pyx_v_self->name);
6891 5 : __pyx_v_self->name = __pyx_v_name;
6892 :
6893 : /* "View.MemoryView":304
6894 : * cdef class Enum(object):
6895 : * cdef object name
6896 : * def __init__(self, name): # <<<<<<<<<<<<<<
6897 : * self.name = name
6898 : * def __repr__(self):
6899 : */
6900 :
6901 : /* function exit code */
6902 5 : __pyx_r = 0;
6903 5 : __Pyx_RefNannyFinishContext();
6904 5 : return __pyx_r;
6905 : }
6906 :
6907 : /* "View.MemoryView":306
6908 : * def __init__(self, name):
6909 : * self.name = name
6910 : * def __repr__(self): # <<<<<<<<<<<<<<
6911 : * return self.name
6912 : *
6913 : */
6914 :
6915 : /* Python wrapper */
6916 : static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
6917 0 : static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
6918 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6919 0 : PyObject *__pyx_r = 0;
6920 : __Pyx_RefNannyDeclarations
6921 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
6922 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6923 0 : __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6924 :
6925 : /* function exit code */
6926 0 : __Pyx_RefNannyFinishContext();
6927 0 : return __pyx_r;
6928 : }
6929 :
6930 0 : static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
6931 0 : PyObject *__pyx_r = NULL;
6932 : __Pyx_RefNannyDeclarations
6933 0 : __Pyx_RefNannySetupContext("__repr__", 1);
6934 :
6935 : /* "View.MemoryView":307
6936 : * self.name = name
6937 : * def __repr__(self):
6938 : * return self.name # <<<<<<<<<<<<<<
6939 : *
6940 : * cdef generic = Enum("<strided and direct or indirect>")
6941 : */
6942 0 : __Pyx_XDECREF(__pyx_r);
6943 0 : __Pyx_INCREF(__pyx_v_self->name);
6944 0 : __pyx_r = __pyx_v_self->name;
6945 0 : goto __pyx_L0;
6946 :
6947 : /* "View.MemoryView":306
6948 : * def __init__(self, name):
6949 : * self.name = name
6950 : * def __repr__(self): # <<<<<<<<<<<<<<
6951 : * return self.name
6952 : *
6953 : */
6954 :
6955 : /* function exit code */
6956 0 : __pyx_L0:;
6957 0 : __Pyx_XGIVEREF(__pyx_r);
6958 0 : __Pyx_RefNannyFinishContext();
6959 0 : return __pyx_r;
6960 : }
6961 :
6962 : /* "(tree fragment)":1
6963 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6964 : * cdef tuple state
6965 : * cdef object _dict
6966 : */
6967 :
6968 : /* Python wrapper */
6969 : static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
6970 : #if CYTHON_METH_FASTCALL
6971 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6972 : #else
6973 : PyObject *__pyx_args, PyObject *__pyx_kwds
6974 : #endif
6975 : ); /*proto*/
6976 0 : static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
6977 : #if CYTHON_METH_FASTCALL
6978 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6979 : #else
6980 : PyObject *__pyx_args, PyObject *__pyx_kwds
6981 : #endif
6982 : ) {
6983 : #if !CYTHON_METH_FASTCALL
6984 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6985 : #endif
6986 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6987 0 : PyObject *__pyx_r = 0;
6988 : __Pyx_RefNannyDeclarations
6989 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6990 : #if !CYTHON_METH_FASTCALL
6991 : #if CYTHON_ASSUME_SAFE_MACROS
6992 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6993 : #else
6994 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6995 : #endif
6996 : #endif
6997 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6998 0 : if (unlikely(__pyx_nargs > 0)) {
6999 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
7000 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
7001 0 : __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7002 :
7003 : /* function exit code */
7004 0 : __Pyx_RefNannyFinishContext();
7005 0 : return __pyx_r;
7006 : }
7007 :
7008 0 : static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7009 0 : PyObject *__pyx_v_state = 0;
7010 0 : PyObject *__pyx_v__dict = 0;
7011 0 : int __pyx_v_use_setstate;
7012 0 : PyObject *__pyx_r = NULL;
7013 : __Pyx_RefNannyDeclarations
7014 0 : PyObject *__pyx_t_1 = NULL;
7015 0 : int __pyx_t_2;
7016 0 : PyObject *__pyx_t_3 = NULL;
7017 0 : PyObject *__pyx_t_4 = NULL;
7018 0 : int __pyx_lineno = 0;
7019 0 : const char *__pyx_filename = NULL;
7020 0 : int __pyx_clineno = 0;
7021 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
7022 :
7023 : /* "(tree fragment)":5
7024 : * cdef object _dict
7025 : * cdef bint use_setstate
7026 : * state = (self.name,) # <<<<<<<<<<<<<<
7027 : * _dict = getattr(self, '__dict__', None)
7028 : * if _dict is not None:
7029 : */
7030 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
7031 0 : __Pyx_GOTREF(__pyx_t_1);
7032 0 : __Pyx_INCREF(__pyx_v_self->name);
7033 0 : __Pyx_GIVEREF(__pyx_v_self->name);
7034 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name)) __PYX_ERR(1, 5, __pyx_L1_error);
7035 0 : __pyx_v_state = ((PyObject*)__pyx_t_1);
7036 0 : __pyx_t_1 = 0;
7037 :
7038 : /* "(tree fragment)":6
7039 : * cdef bint use_setstate
7040 : * state = (self.name,)
7041 : * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
7042 : * if _dict is not None:
7043 : * state += (_dict,)
7044 : */
7045 0 : __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
7046 0 : __Pyx_GOTREF(__pyx_t_1);
7047 0 : __pyx_v__dict = __pyx_t_1;
7048 0 : __pyx_t_1 = 0;
7049 :
7050 : /* "(tree fragment)":7
7051 : * state = (self.name,)
7052 : * _dict = getattr(self, '__dict__', None)
7053 : * if _dict is not None: # <<<<<<<<<<<<<<
7054 : * state += (_dict,)
7055 : * use_setstate = True
7056 : */
7057 0 : __pyx_t_2 = (__pyx_v__dict != Py_None);
7058 0 : if (__pyx_t_2) {
7059 :
7060 : /* "(tree fragment)":8
7061 : * _dict = getattr(self, '__dict__', None)
7062 : * if _dict is not None:
7063 : * state += (_dict,) # <<<<<<<<<<<<<<
7064 : * use_setstate = True
7065 : * else:
7066 : */
7067 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
7068 0 : __Pyx_GOTREF(__pyx_t_1);
7069 0 : __Pyx_INCREF(__pyx_v__dict);
7070 0 : __Pyx_GIVEREF(__pyx_v__dict);
7071 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error);
7072 0 : __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
7073 0 : __Pyx_GOTREF(__pyx_t_3);
7074 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7075 0 : __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
7076 0 : __pyx_t_3 = 0;
7077 :
7078 : /* "(tree fragment)":9
7079 : * if _dict is not None:
7080 : * state += (_dict,)
7081 : * use_setstate = True # <<<<<<<<<<<<<<
7082 : * else:
7083 : * use_setstate = self.name is not None
7084 : */
7085 0 : __pyx_v_use_setstate = 1;
7086 :
7087 : /* "(tree fragment)":7
7088 : * state = (self.name,)
7089 : * _dict = getattr(self, '__dict__', None)
7090 : * if _dict is not None: # <<<<<<<<<<<<<<
7091 : * state += (_dict,)
7092 : * use_setstate = True
7093 : */
7094 0 : goto __pyx_L3;
7095 : }
7096 :
7097 : /* "(tree fragment)":11
7098 : * use_setstate = True
7099 : * else:
7100 : * use_setstate = self.name is not None # <<<<<<<<<<<<<<
7101 : * if use_setstate:
7102 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7103 : */
7104 : /*else*/ {
7105 0 : __pyx_t_2 = (__pyx_v_self->name != Py_None);
7106 0 : __pyx_v_use_setstate = __pyx_t_2;
7107 : }
7108 0 : __pyx_L3:;
7109 :
7110 : /* "(tree fragment)":12
7111 : * else:
7112 : * use_setstate = self.name is not None
7113 : * if use_setstate: # <<<<<<<<<<<<<<
7114 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7115 : * else:
7116 : */
7117 0 : if (__pyx_v_use_setstate) {
7118 :
7119 : /* "(tree fragment)":13
7120 : * use_setstate = self.name is not None
7121 : * if use_setstate:
7122 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
7123 : * else:
7124 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7125 : */
7126 0 : __Pyx_XDECREF(__pyx_r);
7127 0 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
7128 0 : __Pyx_GOTREF(__pyx_t_3);
7129 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
7130 0 : __Pyx_GOTREF(__pyx_t_1);
7131 0 : __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7132 0 : __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7133 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error);
7134 0 : __Pyx_INCREF(__pyx_int_136983863);
7135 0 : __Pyx_GIVEREF(__pyx_int_136983863);
7136 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(1, 13, __pyx_L1_error);
7137 0 : __Pyx_INCREF(Py_None);
7138 0 : __Pyx_GIVEREF(Py_None);
7139 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error);
7140 0 : __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
7141 0 : __Pyx_GOTREF(__pyx_t_4);
7142 0 : __Pyx_GIVEREF(__pyx_t_3);
7143 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error);
7144 0 : __Pyx_GIVEREF(__pyx_t_1);
7145 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error);
7146 0 : __Pyx_INCREF(__pyx_v_state);
7147 0 : __Pyx_GIVEREF(__pyx_v_state);
7148 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error);
7149 0 : __pyx_t_3 = 0;
7150 0 : __pyx_t_1 = 0;
7151 0 : __pyx_r = __pyx_t_4;
7152 0 : __pyx_t_4 = 0;
7153 0 : goto __pyx_L0;
7154 :
7155 : /* "(tree fragment)":12
7156 : * else:
7157 : * use_setstate = self.name is not None
7158 : * if use_setstate: # <<<<<<<<<<<<<<
7159 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7160 : * else:
7161 : */
7162 : }
7163 :
7164 : /* "(tree fragment)":15
7165 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7166 : * else:
7167 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<<
7168 : * def __setstate_cython__(self, __pyx_state):
7169 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7170 : */
7171 : /*else*/ {
7172 0 : __Pyx_XDECREF(__pyx_r);
7173 0 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
7174 0 : __Pyx_GOTREF(__pyx_t_4);
7175 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
7176 0 : __Pyx_GOTREF(__pyx_t_1);
7177 0 : __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7178 0 : __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7179 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error);
7180 0 : __Pyx_INCREF(__pyx_int_136983863);
7181 0 : __Pyx_GIVEREF(__pyx_int_136983863);
7182 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(1, 15, __pyx_L1_error);
7183 0 : __Pyx_INCREF(__pyx_v_state);
7184 0 : __Pyx_GIVEREF(__pyx_v_state);
7185 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error);
7186 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
7187 0 : __Pyx_GOTREF(__pyx_t_3);
7188 0 : __Pyx_GIVEREF(__pyx_t_4);
7189 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error);
7190 0 : __Pyx_GIVEREF(__pyx_t_1);
7191 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error);
7192 0 : __pyx_t_4 = 0;
7193 0 : __pyx_t_1 = 0;
7194 0 : __pyx_r = __pyx_t_3;
7195 0 : __pyx_t_3 = 0;
7196 0 : goto __pyx_L0;
7197 : }
7198 :
7199 : /* "(tree fragment)":1
7200 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7201 : * cdef tuple state
7202 : * cdef object _dict
7203 : */
7204 :
7205 : /* function exit code */
7206 0 : __pyx_L1_error:;
7207 0 : __Pyx_XDECREF(__pyx_t_1);
7208 0 : __Pyx_XDECREF(__pyx_t_3);
7209 0 : __Pyx_XDECREF(__pyx_t_4);
7210 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7211 0 : __pyx_r = NULL;
7212 0 : __pyx_L0:;
7213 0 : __Pyx_XDECREF(__pyx_v_state);
7214 0 : __Pyx_XDECREF(__pyx_v__dict);
7215 0 : __Pyx_XGIVEREF(__pyx_r);
7216 0 : __Pyx_RefNannyFinishContext();
7217 0 : return __pyx_r;
7218 : }
7219 :
7220 : /* "(tree fragment)":16
7221 : * else:
7222 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7223 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7224 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7225 : */
7226 :
7227 : /* Python wrapper */
7228 : static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7229 : #if CYTHON_METH_FASTCALL
7230 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7231 : #else
7232 : PyObject *__pyx_args, PyObject *__pyx_kwds
7233 : #endif
7234 : ); /*proto*/
7235 0 : static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7236 : #if CYTHON_METH_FASTCALL
7237 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7238 : #else
7239 : PyObject *__pyx_args, PyObject *__pyx_kwds
7240 : #endif
7241 : ) {
7242 0 : PyObject *__pyx_v___pyx_state = 0;
7243 : #if !CYTHON_METH_FASTCALL
7244 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7245 : #endif
7246 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7247 0 : PyObject* values[1] = {0};
7248 0 : int __pyx_lineno = 0;
7249 0 : const char *__pyx_filename = NULL;
7250 0 : int __pyx_clineno = 0;
7251 0 : PyObject *__pyx_r = 0;
7252 : __Pyx_RefNannyDeclarations
7253 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7254 : #if !CYTHON_METH_FASTCALL
7255 : #if CYTHON_ASSUME_SAFE_MACROS
7256 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7257 : #else
7258 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7259 : #endif
7260 : #endif
7261 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7262 : {
7263 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
7264 0 : if (__pyx_kwds) {
7265 0 : Py_ssize_t kw_args;
7266 0 : switch (__pyx_nargs) {
7267 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
7268 0 : CYTHON_FALLTHROUGH;
7269 0 : case 0: break;
7270 0 : default: goto __pyx_L5_argtuple_error;
7271 : }
7272 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
7273 0 : switch (__pyx_nargs) {
7274 : case 0:
7275 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
7276 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
7277 0 : kw_args--;
7278 : }
7279 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error)
7280 0 : else goto __pyx_L5_argtuple_error;
7281 : }
7282 0 : if (unlikely(kw_args > 0)) {
7283 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7284 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error)
7285 : }
7286 0 : } else if (unlikely(__pyx_nargs != 1)) {
7287 0 : goto __pyx_L5_argtuple_error;
7288 : } else {
7289 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
7290 : }
7291 0 : __pyx_v___pyx_state = values[0];
7292 : }
7293 0 : goto __pyx_L6_skip;
7294 0 : __pyx_L5_argtuple_error:;
7295 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error)
7296 0 : __pyx_L6_skip:;
7297 0 : goto __pyx_L4_argument_unpacking_done;
7298 0 : __pyx_L3_error:;
7299 : {
7300 0 : Py_ssize_t __pyx_temp;
7301 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7302 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
7303 : }
7304 : }
7305 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7306 0 : __Pyx_RefNannyFinishContext();
7307 0 : return NULL;
7308 0 : __pyx_L4_argument_unpacking_done:;
7309 0 : __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
7310 :
7311 : /* function exit code */
7312 : {
7313 0 : Py_ssize_t __pyx_temp;
7314 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7315 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
7316 : }
7317 : }
7318 : __Pyx_RefNannyFinishContext();
7319 : return __pyx_r;
7320 : }
7321 :
7322 0 : static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7323 0 : PyObject *__pyx_r = NULL;
7324 : __Pyx_RefNannyDeclarations
7325 0 : PyObject *__pyx_t_1 = NULL;
7326 0 : int __pyx_lineno = 0;
7327 0 : const char *__pyx_filename = NULL;
7328 0 : int __pyx_clineno = 0;
7329 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
7330 :
7331 : /* "(tree fragment)":17
7332 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7333 : * def __setstate_cython__(self, __pyx_state):
7334 : * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
7335 : */
7336 0 : if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error)
7337 0 : __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
7338 0 : __Pyx_GOTREF(__pyx_t_1);
7339 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7340 :
7341 : /* "(tree fragment)":16
7342 : * else:
7343 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7344 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7345 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7346 : */
7347 :
7348 : /* function exit code */
7349 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7350 0 : goto __pyx_L0;
7351 0 : __pyx_L1_error:;
7352 0 : __Pyx_XDECREF(__pyx_t_1);
7353 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7354 0 : __pyx_r = NULL;
7355 0 : __pyx_L0:;
7356 0 : __Pyx_XGIVEREF(__pyx_r);
7357 0 : __Pyx_RefNannyFinishContext();
7358 0 : return __pyx_r;
7359 : }
7360 :
7361 : /* "View.MemoryView":349
7362 : * cdef __Pyx_TypeInfo *typeinfo
7363 : *
7364 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7365 : * self.obj = obj
7366 : * self.flags = flags
7367 : */
7368 :
7369 : /* Python wrapper */
7370 : static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7371 2302 : static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7372 2302 : PyObject *__pyx_v_obj = 0;
7373 2302 : int __pyx_v_flags;
7374 2302 : int __pyx_v_dtype_is_object;
7375 2302 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7376 2302 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7377 2302 : PyObject* values[3] = {0,0,0};
7378 2302 : int __pyx_lineno = 0;
7379 2302 : const char *__pyx_filename = NULL;
7380 2302 : int __pyx_clineno = 0;
7381 2302 : int __pyx_r;
7382 : __Pyx_RefNannyDeclarations
7383 2302 : __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7384 : #if CYTHON_ASSUME_SAFE_MACROS
7385 2302 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7386 : #else
7387 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7388 : #endif
7389 2302 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7390 : {
7391 2302 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
7392 2302 : if (__pyx_kwds) {
7393 0 : Py_ssize_t kw_args;
7394 0 : switch (__pyx_nargs) {
7395 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
7396 0 : CYTHON_FALLTHROUGH;
7397 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
7398 0 : CYTHON_FALLTHROUGH;
7399 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7400 0 : CYTHON_FALLTHROUGH;
7401 0 : case 0: break;
7402 0 : default: goto __pyx_L5_argtuple_error;
7403 : }
7404 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
7405 0 : switch (__pyx_nargs) {
7406 0 : case 0:
7407 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) {
7408 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
7409 0 : kw_args--;
7410 : }
7411 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7412 0 : else goto __pyx_L5_argtuple_error;
7413 0 : CYTHON_FALLTHROUGH;
7414 : case 1:
7415 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) {
7416 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
7417 0 : kw_args--;
7418 : }
7419 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7420 : else {
7421 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 349, __pyx_L3_error)
7422 : }
7423 0 : CYTHON_FALLTHROUGH;
7424 : case 2:
7425 0 : if (kw_args > 0) {
7426 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtype_is_object);
7427 0 : if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
7428 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7429 : }
7430 : }
7431 0 : if (unlikely(kw_args > 0)) {
7432 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7433 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 349, __pyx_L3_error)
7434 : }
7435 : } else {
7436 2302 : switch (__pyx_nargs) {
7437 2302 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
7438 2302 : CYTHON_FALLTHROUGH;
7439 2302 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
7440 2302 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7441 2302 : break;
7442 0 : default: goto __pyx_L5_argtuple_error;
7443 : }
7444 : }
7445 2302 : __pyx_v_obj = values[0];
7446 2302 : __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7447 2302 : if (values[2]) {
7448 2302 : __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7449 : } else {
7450 : __pyx_v_dtype_is_object = ((int)0);
7451 : }
7452 : }
7453 2302 : goto __pyx_L6_skip;
7454 0 : __pyx_L5_argtuple_error:;
7455 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 349, __pyx_L3_error)
7456 2302 : __pyx_L6_skip:;
7457 2302 : goto __pyx_L4_argument_unpacking_done;
7458 0 : __pyx_L3_error:;
7459 : {
7460 0 : Py_ssize_t __pyx_temp;
7461 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7462 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7463 : }
7464 : }
7465 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7466 0 : __Pyx_RefNannyFinishContext();
7467 0 : return -1;
7468 2302 : __pyx_L4_argument_unpacking_done:;
7469 2302 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
7470 :
7471 : /* function exit code */
7472 : {
7473 2302 : Py_ssize_t __pyx_temp;
7474 2302 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7475 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7476 : }
7477 : }
7478 : __Pyx_RefNannyFinishContext();
7479 : return __pyx_r;
7480 : }
7481 :
7482 2302 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
7483 2302 : int __pyx_r;
7484 : __Pyx_RefNannyDeclarations
7485 2302 : int __pyx_t_1;
7486 2302 : int __pyx_t_2;
7487 2302 : int __pyx_t_3;
7488 2302 : Py_intptr_t __pyx_t_4;
7489 2302 : size_t __pyx_t_5;
7490 2302 : int __pyx_lineno = 0;
7491 2302 : const char *__pyx_filename = NULL;
7492 2302 : int __pyx_clineno = 0;
7493 2302 : __Pyx_RefNannySetupContext("__cinit__", 1);
7494 :
7495 : /* "View.MemoryView":350
7496 : *
7497 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7498 : * self.obj = obj # <<<<<<<<<<<<<<
7499 : * self.flags = flags
7500 : * if type(self) is memoryview or obj is not None:
7501 : */
7502 2302 : __Pyx_INCREF(__pyx_v_obj);
7503 2302 : __Pyx_GIVEREF(__pyx_v_obj);
7504 2302 : __Pyx_GOTREF(__pyx_v_self->obj);
7505 2302 : __Pyx_DECREF(__pyx_v_self->obj);
7506 2302 : __pyx_v_self->obj = __pyx_v_obj;
7507 :
7508 : /* "View.MemoryView":351
7509 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7510 : * self.obj = obj
7511 : * self.flags = flags # <<<<<<<<<<<<<<
7512 : * if type(self) is memoryview or obj is not None:
7513 : * __Pyx_GetBuffer(obj, &self.view, flags)
7514 : */
7515 2302 : __pyx_v_self->flags = __pyx_v_flags;
7516 :
7517 : /* "View.MemoryView":352
7518 : * self.obj = obj
7519 : * self.flags = flags
7520 : * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7521 : * __Pyx_GetBuffer(obj, &self.view, flags)
7522 : * if <PyObject *> self.view.obj == NULL:
7523 : */
7524 2302 : __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
7525 2302 : if (!__pyx_t_2) {
7526 338 : } else {
7527 1964 : __pyx_t_1 = __pyx_t_2;
7528 1964 : goto __pyx_L4_bool_binop_done;
7529 : }
7530 338 : __pyx_t_2 = (__pyx_v_obj != Py_None);
7531 338 : __pyx_t_1 = __pyx_t_2;
7532 2302 : __pyx_L4_bool_binop_done:;
7533 2302 : if (__pyx_t_1) {
7534 :
7535 : /* "View.MemoryView":353
7536 : * self.flags = flags
7537 : * if type(self) is memoryview or obj is not None:
7538 : * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
7539 : * if <PyObject *> self.view.obj == NULL:
7540 : * (<__pyx_buffer *> &self.view).obj = Py_None
7541 : */
7542 1964 : __pyx_t_3 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 353, __pyx_L1_error)
7543 :
7544 : /* "View.MemoryView":354
7545 : * if type(self) is memoryview or obj is not None:
7546 : * __Pyx_GetBuffer(obj, &self.view, flags)
7547 : * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7548 : * (<__pyx_buffer *> &self.view).obj = Py_None
7549 : * Py_INCREF(Py_None)
7550 : */
7551 1964 : __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
7552 1964 : if (__pyx_t_1) {
7553 :
7554 : /* "View.MemoryView":355
7555 : * __Pyx_GetBuffer(obj, &self.view, flags)
7556 : * if <PyObject *> self.view.obj == NULL:
7557 : * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
7558 : * Py_INCREF(Py_None)
7559 : *
7560 : */
7561 0 : ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
7562 :
7563 : /* "View.MemoryView":356
7564 : * if <PyObject *> self.view.obj == NULL:
7565 : * (<__pyx_buffer *> &self.view).obj = Py_None
7566 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7567 : *
7568 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
7569 : */
7570 0 : Py_INCREF(Py_None);
7571 :
7572 : /* "View.MemoryView":354
7573 : * if type(self) is memoryview or obj is not None:
7574 : * __Pyx_GetBuffer(obj, &self.view, flags)
7575 : * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7576 : * (<__pyx_buffer *> &self.view).obj = Py_None
7577 : * Py_INCREF(Py_None)
7578 : */
7579 : }
7580 :
7581 : /* "View.MemoryView":352
7582 : * self.obj = obj
7583 : * self.flags = flags
7584 : * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7585 : * __Pyx_GetBuffer(obj, &self.view, flags)
7586 : * if <PyObject *> self.view.obj == NULL:
7587 : */
7588 : }
7589 :
7590 : /* "View.MemoryView":358
7591 : * Py_INCREF(Py_None)
7592 : *
7593 : * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7594 : * global __pyx_memoryview_thread_locks_used
7595 : * if __pyx_memoryview_thread_locks_used < 8:
7596 : */
7597 2302 : __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
7598 2302 : if (__pyx_t_1) {
7599 :
7600 : /* "View.MemoryView":360
7601 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
7602 : * global __pyx_memoryview_thread_locks_used
7603 : * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
7604 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7605 : * __pyx_memoryview_thread_locks_used += 1
7606 : */
7607 : __pyx_t_1 = (__pyx_memoryview_thread_locks_used < 8);
7608 : if (__pyx_t_1) {
7609 :
7610 : /* "View.MemoryView":361
7611 : * global __pyx_memoryview_thread_locks_used
7612 : * if __pyx_memoryview_thread_locks_used < 8:
7613 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
7614 : * __pyx_memoryview_thread_locks_used += 1
7615 : * if self.lock is NULL:
7616 : */
7617 : __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7618 :
7619 : /* "View.MemoryView":362
7620 : * if __pyx_memoryview_thread_locks_used < 8:
7621 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7622 : * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
7623 : * if self.lock is NULL:
7624 : * self.lock = PyThread_allocate_lock()
7625 : */
7626 : __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
7627 :
7628 : /* "View.MemoryView":360
7629 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
7630 : * global __pyx_memoryview_thread_locks_used
7631 : * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
7632 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7633 : * __pyx_memoryview_thread_locks_used += 1
7634 : */
7635 : }
7636 :
7637 : /* "View.MemoryView":363
7638 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7639 : * __pyx_memoryview_thread_locks_used += 1
7640 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7641 : * self.lock = PyThread_allocate_lock()
7642 : * if self.lock is NULL:
7643 : */
7644 : __pyx_t_1 = (__pyx_v_self->lock == NULL);
7645 : if (__pyx_t_1) {
7646 :
7647 : /* "View.MemoryView":364
7648 : * __pyx_memoryview_thread_locks_used += 1
7649 : * if self.lock is NULL:
7650 : * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
7651 : * if self.lock is NULL:
7652 : * raise MemoryError
7653 : */
7654 : __pyx_v_self->lock = PyThread_allocate_lock();
7655 :
7656 : /* "View.MemoryView":365
7657 : * if self.lock is NULL:
7658 : * self.lock = PyThread_allocate_lock()
7659 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7660 : * raise MemoryError
7661 : *
7662 : */
7663 : __pyx_t_1 = (__pyx_v_self->lock == NULL);
7664 : if (unlikely(__pyx_t_1)) {
7665 :
7666 : /* "View.MemoryView":366
7667 : * self.lock = PyThread_allocate_lock()
7668 : * if self.lock is NULL:
7669 : * raise MemoryError # <<<<<<<<<<<<<<
7670 : *
7671 : * if flags & PyBUF_FORMAT:
7672 : */
7673 : PyErr_NoMemory(); __PYX_ERR(1, 366, __pyx_L1_error)
7674 :
7675 : /* "View.MemoryView":365
7676 : * if self.lock is NULL:
7677 : * self.lock = PyThread_allocate_lock()
7678 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7679 : * raise MemoryError
7680 : *
7681 : */
7682 : }
7683 :
7684 : /* "View.MemoryView":363
7685 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7686 : * __pyx_memoryview_thread_locks_used += 1
7687 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7688 : * self.lock = PyThread_allocate_lock()
7689 : * if self.lock is NULL:
7690 : */
7691 : }
7692 :
7693 : /* "View.MemoryView":358
7694 : * Py_INCREF(Py_None)
7695 : *
7696 : * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7697 : * global __pyx_memoryview_thread_locks_used
7698 : * if __pyx_memoryview_thread_locks_used < 8:
7699 : */
7700 : }
7701 :
7702 : /* "View.MemoryView":368
7703 : * raise MemoryError
7704 : *
7705 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7706 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7707 : * else:
7708 : */
7709 2302 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7710 2302 : if (__pyx_t_1) {
7711 :
7712 : /* "View.MemoryView":369
7713 : *
7714 : * if flags & PyBUF_FORMAT:
7715 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
7716 : * else:
7717 : * self.dtype_is_object = dtype_is_object
7718 : */
7719 1964 : __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
7720 1964 : if (__pyx_t_2) {
7721 0 : } else {
7722 1964 : __pyx_t_1 = __pyx_t_2;
7723 1964 : goto __pyx_L12_bool_binop_done;
7724 : }
7725 0 : __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
7726 0 : __pyx_t_1 = __pyx_t_2;
7727 1964 : __pyx_L12_bool_binop_done:;
7728 1964 : __pyx_v_self->dtype_is_object = __pyx_t_1;
7729 :
7730 : /* "View.MemoryView":368
7731 : * raise MemoryError
7732 : *
7733 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7734 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7735 : * else:
7736 : */
7737 1964 : goto __pyx_L11;
7738 : }
7739 :
7740 : /* "View.MemoryView":371
7741 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7742 : * else:
7743 : * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
7744 : *
7745 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
7746 : */
7747 : /*else*/ {
7748 338 : __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
7749 : }
7750 2302 : __pyx_L11:;
7751 :
7752 : /* "View.MemoryView":373
7753 : * self.dtype_is_object = dtype_is_object
7754 : *
7755 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
7756 : * self.typeinfo = NULL
7757 : *
7758 : */
7759 : #ifndef CYTHON_WITHOUT_ASSERTIONS
7760 2302 : if (unlikely(__pyx_assertions_enabled())) {
7761 2302 : __pyx_t_4 = ((Py_intptr_t)((void *)(&__pyx_v_self->acquisition_count)));
7762 2302 : __pyx_t_5 = (sizeof(__pyx_atomic_int_type));
7763 2302 : if (unlikely(__pyx_t_5 == 0)) {
7764 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
7765 : __PYX_ERR(1, 373, __pyx_L1_error)
7766 : }
7767 2302 : __pyx_t_1 = ((__pyx_t_4 % __pyx_t_5) == 0);
7768 2302 : if (unlikely(!__pyx_t_1)) {
7769 0 : __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
7770 0 : __PYX_ERR(1, 373, __pyx_L1_error)
7771 : }
7772 : }
7773 : #else
7774 : if ((1)); else __PYX_ERR(1, 373, __pyx_L1_error)
7775 : #endif
7776 :
7777 : /* "View.MemoryView":374
7778 : *
7779 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
7780 : * self.typeinfo = NULL # <<<<<<<<<<<<<<
7781 : *
7782 : * def __dealloc__(memoryview self):
7783 : */
7784 2302 : __pyx_v_self->typeinfo = NULL;
7785 :
7786 : /* "View.MemoryView":349
7787 : * cdef __Pyx_TypeInfo *typeinfo
7788 : *
7789 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7790 : * self.obj = obj
7791 : * self.flags = flags
7792 : */
7793 :
7794 : /* function exit code */
7795 2302 : __pyx_r = 0;
7796 2302 : goto __pyx_L0;
7797 0 : __pyx_L1_error:;
7798 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7799 0 : __pyx_r = -1;
7800 2302 : __pyx_L0:;
7801 2302 : __Pyx_RefNannyFinishContext();
7802 2302 : return __pyx_r;
7803 : }
7804 :
7805 : /* "View.MemoryView":376
7806 : * self.typeinfo = NULL
7807 : *
7808 : * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
7809 : * if self.obj is not None:
7810 : * __Pyx_ReleaseBuffer(&self.view)
7811 : */
7812 :
7813 : /* Python wrapper */
7814 : static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
7815 2302 : static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
7816 2302 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7817 : __Pyx_RefNannyDeclarations
7818 2302 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
7819 2302 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7820 2302 : __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
7821 :
7822 : /* function exit code */
7823 2302 : __Pyx_RefNannyFinishContext();
7824 : }
7825 :
7826 2302 : static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
7827 2302 : int __pyx_v_i;
7828 2302 : int __pyx_t_1;
7829 2302 : int __pyx_t_2;
7830 2302 : int __pyx_t_3;
7831 2302 : int __pyx_t_4;
7832 2302 : PyThread_type_lock __pyx_t_5;
7833 2302 : PyThread_type_lock __pyx_t_6;
7834 :
7835 : /* "View.MemoryView":377
7836 : *
7837 : * def __dealloc__(memoryview self):
7838 : * if self.obj is not None: # <<<<<<<<<<<<<<
7839 : * __Pyx_ReleaseBuffer(&self.view)
7840 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7841 : */
7842 2302 : __pyx_t_1 = (__pyx_v_self->obj != Py_None);
7843 2302 : if (__pyx_t_1) {
7844 :
7845 : /* "View.MemoryView":378
7846 : * def __dealloc__(memoryview self):
7847 : * if self.obj is not None:
7848 : * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
7849 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7850 : *
7851 : */
7852 1964 : __Pyx_ReleaseBuffer((&__pyx_v_self->view));
7853 :
7854 : /* "View.MemoryView":377
7855 : *
7856 : * def __dealloc__(memoryview self):
7857 : * if self.obj is not None: # <<<<<<<<<<<<<<
7858 : * __Pyx_ReleaseBuffer(&self.view)
7859 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7860 : */
7861 1964 : goto __pyx_L3;
7862 : }
7863 :
7864 : /* "View.MemoryView":379
7865 : * if self.obj is not None:
7866 : * __Pyx_ReleaseBuffer(&self.view)
7867 : * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
7868 : *
7869 : * (<__pyx_buffer *> &self.view).obj = NULL
7870 : */
7871 338 : __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
7872 338 : if (__pyx_t_1) {
7873 :
7874 : /* "View.MemoryView":381
7875 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7876 : *
7877 : * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
7878 : * Py_DECREF(Py_None)
7879 : *
7880 : */
7881 338 : ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
7882 :
7883 : /* "View.MemoryView":382
7884 : *
7885 : * (<__pyx_buffer *> &self.view).obj = NULL
7886 : * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
7887 : *
7888 : * cdef int i
7889 : */
7890 338 : Py_DECREF(Py_None);
7891 :
7892 : /* "View.MemoryView":379
7893 : * if self.obj is not None:
7894 : * __Pyx_ReleaseBuffer(&self.view)
7895 : * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
7896 : *
7897 : * (<__pyx_buffer *> &self.view).obj = NULL
7898 : */
7899 : }
7900 0 : __pyx_L3:;
7901 :
7902 : /* "View.MemoryView":386
7903 : * cdef int i
7904 : * global __pyx_memoryview_thread_locks_used
7905 : * if self.lock != NULL: # <<<<<<<<<<<<<<
7906 : * for i in range(__pyx_memoryview_thread_locks_used):
7907 : * if __pyx_memoryview_thread_locks[i] is self.lock:
7908 : */
7909 2302 : __pyx_t_1 = (__pyx_v_self->lock != NULL);
7910 2302 : if (__pyx_t_1) {
7911 :
7912 : /* "View.MemoryView":387
7913 : * global __pyx_memoryview_thread_locks_used
7914 : * if self.lock != NULL:
7915 : * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
7916 : * if __pyx_memoryview_thread_locks[i] is self.lock:
7917 : * __pyx_memoryview_thread_locks_used -= 1
7918 : */
7919 0 : __pyx_t_2 = __pyx_memoryview_thread_locks_used;
7920 0 : __pyx_t_3 = __pyx_t_2;
7921 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
7922 0 : __pyx_v_i = __pyx_t_4;
7923 :
7924 : /* "View.MemoryView":388
7925 : * if self.lock != NULL:
7926 : * for i in range(__pyx_memoryview_thread_locks_used):
7927 : * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
7928 : * __pyx_memoryview_thread_locks_used -= 1
7929 : * if i != __pyx_memoryview_thread_locks_used:
7930 : */
7931 0 : __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
7932 0 : if (__pyx_t_1) {
7933 :
7934 : /* "View.MemoryView":389
7935 : * for i in range(__pyx_memoryview_thread_locks_used):
7936 : * if __pyx_memoryview_thread_locks[i] is self.lock:
7937 : * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
7938 : * if i != __pyx_memoryview_thread_locks_used:
7939 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7940 : */
7941 0 : __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
7942 :
7943 : /* "View.MemoryView":390
7944 : * if __pyx_memoryview_thread_locks[i] is self.lock:
7945 : * __pyx_memoryview_thread_locks_used -= 1
7946 : * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
7947 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7948 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7949 : */
7950 0 : __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
7951 0 : if (__pyx_t_1) {
7952 :
7953 : /* "View.MemoryView":392
7954 : * if i != __pyx_memoryview_thread_locks_used:
7955 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7956 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
7957 : * break
7958 : * else:
7959 : */
7960 0 : __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7961 0 : __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
7962 :
7963 : /* "View.MemoryView":391
7964 : * __pyx_memoryview_thread_locks_used -= 1
7965 : * if i != __pyx_memoryview_thread_locks_used:
7966 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
7967 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7968 : * break
7969 : */
7970 0 : (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
7971 0 : (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
7972 :
7973 : /* "View.MemoryView":390
7974 : * if __pyx_memoryview_thread_locks[i] is self.lock:
7975 : * __pyx_memoryview_thread_locks_used -= 1
7976 : * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
7977 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7978 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7979 : */
7980 : }
7981 :
7982 : /* "View.MemoryView":393
7983 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7984 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7985 : * break # <<<<<<<<<<<<<<
7986 : * else:
7987 : * PyThread_free_lock(self.lock)
7988 : */
7989 0 : goto __pyx_L6_break;
7990 :
7991 : /* "View.MemoryView":388
7992 : * if self.lock != NULL:
7993 : * for i in range(__pyx_memoryview_thread_locks_used):
7994 : * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
7995 : * __pyx_memoryview_thread_locks_used -= 1
7996 : * if i != __pyx_memoryview_thread_locks_used:
7997 : */
7998 : }
7999 : }
8000 : /*else*/ {
8001 :
8002 : /* "View.MemoryView":395
8003 : * break
8004 : * else:
8005 : * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
8006 : *
8007 : * cdef char *get_item_pointer(memoryview self, object index) except NULL:
8008 : */
8009 0 : PyThread_free_lock(__pyx_v_self->lock);
8010 : }
8011 2302 : __pyx_L6_break:;
8012 :
8013 : /* "View.MemoryView":386
8014 : * cdef int i
8015 : * global __pyx_memoryview_thread_locks_used
8016 : * if self.lock != NULL: # <<<<<<<<<<<<<<
8017 : * for i in range(__pyx_memoryview_thread_locks_used):
8018 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8019 : */
8020 : }
8021 :
8022 : /* "View.MemoryView":376
8023 : * self.typeinfo = NULL
8024 : *
8025 : * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8026 : * if self.obj is not None:
8027 : * __Pyx_ReleaseBuffer(&self.view)
8028 : */
8029 :
8030 : /* function exit code */
8031 2302 : }
8032 :
8033 : /* "View.MemoryView":397
8034 : * PyThread_free_lock(self.lock)
8035 : *
8036 : * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
8037 : * cdef Py_ssize_t dim
8038 : * cdef char *itemp = <char *> self.view.buf
8039 : */
8040 :
8041 0 : static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8042 0 : Py_ssize_t __pyx_v_dim;
8043 0 : char *__pyx_v_itemp;
8044 0 : PyObject *__pyx_v_idx = NULL;
8045 0 : char *__pyx_r;
8046 : __Pyx_RefNannyDeclarations
8047 0 : Py_ssize_t __pyx_t_1;
8048 0 : PyObject *__pyx_t_2 = NULL;
8049 0 : Py_ssize_t __pyx_t_3;
8050 0 : PyObject *(*__pyx_t_4)(PyObject *);
8051 0 : PyObject *__pyx_t_5 = NULL;
8052 0 : Py_ssize_t __pyx_t_6;
8053 0 : char *__pyx_t_7;
8054 0 : int __pyx_lineno = 0;
8055 0 : const char *__pyx_filename = NULL;
8056 0 : int __pyx_clineno = 0;
8057 0 : __Pyx_RefNannySetupContext("get_item_pointer", 1);
8058 :
8059 : /* "View.MemoryView":399
8060 : * cdef char *get_item_pointer(memoryview self, object index) except NULL:
8061 : * cdef Py_ssize_t dim
8062 : * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
8063 : *
8064 : * for dim, idx in enumerate(index):
8065 : */
8066 0 : __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
8067 :
8068 : /* "View.MemoryView":401
8069 : * cdef char *itemp = <char *> self.view.buf
8070 : *
8071 : * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8072 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8073 : *
8074 : */
8075 0 : __pyx_t_1 = 0;
8076 0 : if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
8077 0 : __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
8078 0 : __pyx_t_3 = 0;
8079 0 : __pyx_t_4 = NULL;
8080 : } else {
8081 0 : __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 401, __pyx_L1_error)
8082 0 : __Pyx_GOTREF(__pyx_t_2);
8083 0 : __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 401, __pyx_L1_error)
8084 : }
8085 0 : for (;;) {
8086 0 : if (likely(!__pyx_t_4)) {
8087 0 : if (likely(PyList_CheckExact(__pyx_t_2))) {
8088 : {
8089 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
8090 : #if !CYTHON_ASSUME_SAFE_MACROS
8091 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8092 : #endif
8093 0 : if (__pyx_t_3 >= __pyx_temp) break;
8094 : }
8095 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8096 0 : __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8097 : #else
8098 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
8099 : __Pyx_GOTREF(__pyx_t_5);
8100 : #endif
8101 : } else {
8102 : {
8103 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
8104 : #if !CYTHON_ASSUME_SAFE_MACROS
8105 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8106 : #endif
8107 0 : if (__pyx_t_3 >= __pyx_temp) break;
8108 : }
8109 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8110 0 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8111 : #else
8112 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
8113 : __Pyx_GOTREF(__pyx_t_5);
8114 : #endif
8115 : }
8116 : } else {
8117 0 : __pyx_t_5 = __pyx_t_4(__pyx_t_2);
8118 0 : if (unlikely(!__pyx_t_5)) {
8119 0 : PyObject* exc_type = PyErr_Occurred();
8120 0 : if (exc_type) {
8121 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8122 0 : else __PYX_ERR(1, 401, __pyx_L1_error)
8123 : }
8124 : break;
8125 : }
8126 0 : __Pyx_GOTREF(__pyx_t_5);
8127 : }
8128 0 : __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
8129 0 : __pyx_t_5 = 0;
8130 0 : __pyx_v_dim = __pyx_t_1;
8131 0 : __pyx_t_1 = (__pyx_t_1 + 1);
8132 :
8133 : /* "View.MemoryView":402
8134 : *
8135 : * for dim, idx in enumerate(index):
8136 : * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
8137 : *
8138 : * return itemp
8139 : */
8140 0 : __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 402, __pyx_L1_error)
8141 0 : __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 402, __pyx_L1_error)
8142 : __pyx_v_itemp = __pyx_t_7;
8143 :
8144 : /* "View.MemoryView":401
8145 : * cdef char *itemp = <char *> self.view.buf
8146 : *
8147 : * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8148 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8149 : *
8150 : */
8151 : }
8152 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8153 :
8154 : /* "View.MemoryView":404
8155 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8156 : *
8157 : * return itemp # <<<<<<<<<<<<<<
8158 : *
8159 : *
8160 : */
8161 0 : __pyx_r = __pyx_v_itemp;
8162 0 : goto __pyx_L0;
8163 :
8164 : /* "View.MemoryView":397
8165 : * PyThread_free_lock(self.lock)
8166 : *
8167 : * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
8168 : * cdef Py_ssize_t dim
8169 : * cdef char *itemp = <char *> self.view.buf
8170 : */
8171 :
8172 : /* function exit code */
8173 0 : __pyx_L1_error:;
8174 0 : __Pyx_XDECREF(__pyx_t_2);
8175 0 : __Pyx_XDECREF(__pyx_t_5);
8176 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8177 0 : __pyx_r = NULL;
8178 0 : __pyx_L0:;
8179 0 : __Pyx_XDECREF(__pyx_v_idx);
8180 0 : __Pyx_RefNannyFinishContext();
8181 0 : return __pyx_r;
8182 : }
8183 :
8184 : /* "View.MemoryView":407
8185 : *
8186 : *
8187 : * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8188 : * if index is Ellipsis:
8189 : * return self
8190 : */
8191 :
8192 : /* Python wrapper */
8193 : static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
8194 0 : static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8195 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8196 0 : PyObject *__pyx_r = 0;
8197 : __Pyx_RefNannyDeclarations
8198 0 : __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8199 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8200 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8201 :
8202 : /* function exit code */
8203 0 : __Pyx_RefNannyFinishContext();
8204 0 : return __pyx_r;
8205 : }
8206 :
8207 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8208 0 : PyObject *__pyx_v_have_slices = NULL;
8209 0 : PyObject *__pyx_v_indices = NULL;
8210 0 : char *__pyx_v_itemp;
8211 0 : PyObject *__pyx_r = NULL;
8212 : __Pyx_RefNannyDeclarations
8213 0 : int __pyx_t_1;
8214 0 : PyObject *__pyx_t_2 = NULL;
8215 0 : PyObject *__pyx_t_3 = NULL;
8216 0 : PyObject *__pyx_t_4 = NULL;
8217 0 : char *__pyx_t_5;
8218 0 : int __pyx_lineno = 0;
8219 0 : const char *__pyx_filename = NULL;
8220 0 : int __pyx_clineno = 0;
8221 0 : __Pyx_RefNannySetupContext("__getitem__", 1);
8222 :
8223 : /* "View.MemoryView":408
8224 : *
8225 : * def __getitem__(memoryview self, object index):
8226 : * if index is Ellipsis: # <<<<<<<<<<<<<<
8227 : * return self
8228 : *
8229 : */
8230 0 : __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8231 0 : if (__pyx_t_1) {
8232 :
8233 : /* "View.MemoryView":409
8234 : * def __getitem__(memoryview self, object index):
8235 : * if index is Ellipsis:
8236 : * return self # <<<<<<<<<<<<<<
8237 : *
8238 : * have_slices, indices = _unellipsify(index, self.view.ndim)
8239 : */
8240 0 : __Pyx_XDECREF(__pyx_r);
8241 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
8242 0 : __pyx_r = ((PyObject *)__pyx_v_self);
8243 0 : goto __pyx_L0;
8244 :
8245 : /* "View.MemoryView":408
8246 : *
8247 : * def __getitem__(memoryview self, object index):
8248 : * if index is Ellipsis: # <<<<<<<<<<<<<<
8249 : * return self
8250 : *
8251 : */
8252 : }
8253 :
8254 : /* "View.MemoryView":411
8255 : * return self
8256 : *
8257 : * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8258 : *
8259 : * cdef char *itemp
8260 : */
8261 0 : __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 411, __pyx_L1_error)
8262 0 : __Pyx_GOTREF(__pyx_t_2);
8263 0 : if (likely(__pyx_t_2 != Py_None)) {
8264 0 : PyObject* sequence = __pyx_t_2;
8265 0 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8266 0 : if (unlikely(size != 2)) {
8267 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8268 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8269 0 : __PYX_ERR(1, 411, __pyx_L1_error)
8270 : }
8271 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8272 0 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
8273 0 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
8274 0 : __Pyx_INCREF(__pyx_t_3);
8275 0 : __Pyx_INCREF(__pyx_t_4);
8276 : #else
8277 : __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
8278 : __Pyx_GOTREF(__pyx_t_3);
8279 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 411, __pyx_L1_error)
8280 : __Pyx_GOTREF(__pyx_t_4);
8281 : #endif
8282 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8283 : } else {
8284 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 411, __pyx_L1_error)
8285 : }
8286 0 : __pyx_v_have_slices = __pyx_t_3;
8287 0 : __pyx_t_3 = 0;
8288 0 : __pyx_v_indices = __pyx_t_4;
8289 0 : __pyx_t_4 = 0;
8290 :
8291 : /* "View.MemoryView":414
8292 : *
8293 : * cdef char *itemp
8294 : * if have_slices: # <<<<<<<<<<<<<<
8295 : * return memview_slice(self, indices)
8296 : * else:
8297 : */
8298 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 414, __pyx_L1_error)
8299 0 : if (__pyx_t_1) {
8300 :
8301 : /* "View.MemoryView":415
8302 : * cdef char *itemp
8303 : * if have_slices:
8304 : * return memview_slice(self, indices) # <<<<<<<<<<<<<<
8305 : * else:
8306 : * itemp = self.get_item_pointer(indices)
8307 : */
8308 0 : __Pyx_XDECREF(__pyx_r);
8309 0 : __pyx_t_2 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
8310 0 : __Pyx_GOTREF(__pyx_t_2);
8311 0 : __pyx_r = __pyx_t_2;
8312 0 : __pyx_t_2 = 0;
8313 0 : goto __pyx_L0;
8314 :
8315 : /* "View.MemoryView":414
8316 : *
8317 : * cdef char *itemp
8318 : * if have_slices: # <<<<<<<<<<<<<<
8319 : * return memview_slice(self, indices)
8320 : * else:
8321 : */
8322 : }
8323 :
8324 : /* "View.MemoryView":417
8325 : * return memview_slice(self, indices)
8326 : * else:
8327 : * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
8328 : * return self.convert_item_to_object(itemp)
8329 : *
8330 : */
8331 : /*else*/ {
8332 0 : __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(1, 417, __pyx_L1_error)
8333 0 : __pyx_v_itemp = __pyx_t_5;
8334 :
8335 : /* "View.MemoryView":418
8336 : * else:
8337 : * itemp = self.get_item_pointer(indices)
8338 : * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
8339 : *
8340 : * def __setitem__(memoryview self, object index, object value):
8341 : */
8342 0 : __Pyx_XDECREF(__pyx_r);
8343 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
8344 0 : __Pyx_GOTREF(__pyx_t_2);
8345 0 : __pyx_r = __pyx_t_2;
8346 0 : __pyx_t_2 = 0;
8347 0 : goto __pyx_L0;
8348 : }
8349 :
8350 : /* "View.MemoryView":407
8351 : *
8352 : *
8353 : * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8354 : * if index is Ellipsis:
8355 : * return self
8356 : */
8357 :
8358 : /* function exit code */
8359 0 : __pyx_L1_error:;
8360 0 : __Pyx_XDECREF(__pyx_t_2);
8361 0 : __Pyx_XDECREF(__pyx_t_3);
8362 0 : __Pyx_XDECREF(__pyx_t_4);
8363 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8364 0 : __pyx_r = NULL;
8365 0 : __pyx_L0:;
8366 0 : __Pyx_XDECREF(__pyx_v_have_slices);
8367 0 : __Pyx_XDECREF(__pyx_v_indices);
8368 0 : __Pyx_XGIVEREF(__pyx_r);
8369 0 : __Pyx_RefNannyFinishContext();
8370 0 : return __pyx_r;
8371 : }
8372 :
8373 : /* "View.MemoryView":420
8374 : * return self.convert_item_to_object(itemp)
8375 : *
8376 : * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8377 : * if self.view.readonly:
8378 : * raise TypeError, "Cannot assign to read-only memoryview"
8379 : */
8380 :
8381 : /* Python wrapper */
8382 : static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
8383 0 : static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8384 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8385 0 : int __pyx_r;
8386 : __Pyx_RefNannyDeclarations
8387 0 : __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
8388 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8389 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
8390 :
8391 : /* function exit code */
8392 0 : __Pyx_RefNannyFinishContext();
8393 0 : return __pyx_r;
8394 : }
8395 :
8396 0 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8397 0 : PyObject *__pyx_v_have_slices = NULL;
8398 0 : PyObject *__pyx_v_obj = NULL;
8399 0 : int __pyx_r;
8400 : __Pyx_RefNannyDeclarations
8401 0 : PyObject *__pyx_t_1 = NULL;
8402 0 : PyObject *__pyx_t_2 = NULL;
8403 0 : PyObject *__pyx_t_3 = NULL;
8404 0 : int __pyx_t_4;
8405 0 : int __pyx_lineno = 0;
8406 0 : const char *__pyx_filename = NULL;
8407 0 : int __pyx_clineno = 0;
8408 0 : __Pyx_RefNannySetupContext("__setitem__", 0);
8409 0 : __Pyx_INCREF(__pyx_v_index);
8410 :
8411 : /* "View.MemoryView":421
8412 : *
8413 : * def __setitem__(memoryview self, object index, object value):
8414 : * if self.view.readonly: # <<<<<<<<<<<<<<
8415 : * raise TypeError, "Cannot assign to read-only memoryview"
8416 : *
8417 : */
8418 0 : if (unlikely(__pyx_v_self->view.readonly)) {
8419 :
8420 : /* "View.MemoryView":422
8421 : * def __setitem__(memoryview self, object index, object value):
8422 : * if self.view.readonly:
8423 : * raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<<
8424 : *
8425 : * have_slices, index = _unellipsify(index, self.view.ndim)
8426 : */
8427 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Cannot_assign_to_read_only_memor, 0, 0);
8428 0 : __PYX_ERR(1, 422, __pyx_L1_error)
8429 :
8430 : /* "View.MemoryView":421
8431 : *
8432 : * def __setitem__(memoryview self, object index, object value):
8433 : * if self.view.readonly: # <<<<<<<<<<<<<<
8434 : * raise TypeError, "Cannot assign to read-only memoryview"
8435 : *
8436 : */
8437 : }
8438 :
8439 : /* "View.MemoryView":424
8440 : * raise TypeError, "Cannot assign to read-only memoryview"
8441 : *
8442 : * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8443 : *
8444 : * if have_slices:
8445 : */
8446 0 : __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __pyx_L1_error)
8447 0 : __Pyx_GOTREF(__pyx_t_1);
8448 0 : if (likely(__pyx_t_1 != Py_None)) {
8449 0 : PyObject* sequence = __pyx_t_1;
8450 0 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8451 0 : if (unlikely(size != 2)) {
8452 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8453 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8454 0 : __PYX_ERR(1, 424, __pyx_L1_error)
8455 : }
8456 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8457 0 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
8458 0 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
8459 0 : __Pyx_INCREF(__pyx_t_2);
8460 0 : __Pyx_INCREF(__pyx_t_3);
8461 : #else
8462 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
8463 : __Pyx_GOTREF(__pyx_t_2);
8464 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 424, __pyx_L1_error)
8465 : __Pyx_GOTREF(__pyx_t_3);
8466 : #endif
8467 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8468 : } else {
8469 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 424, __pyx_L1_error)
8470 : }
8471 0 : __pyx_v_have_slices = __pyx_t_2;
8472 0 : __pyx_t_2 = 0;
8473 0 : __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
8474 0 : __pyx_t_3 = 0;
8475 :
8476 : /* "View.MemoryView":426
8477 : * have_slices, index = _unellipsify(index, self.view.ndim)
8478 : *
8479 : * if have_slices: # <<<<<<<<<<<<<<
8480 : * obj = self.is_slice(value)
8481 : * if obj is not None:
8482 : */
8483 0 : __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 426, __pyx_L1_error)
8484 0 : if (__pyx_t_4) {
8485 :
8486 : /* "View.MemoryView":427
8487 : *
8488 : * if have_slices:
8489 : * obj = self.is_slice(value) # <<<<<<<<<<<<<<
8490 : * if obj is not None:
8491 : * self.setitem_slice_assignment(self[index], obj)
8492 : */
8493 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 427, __pyx_L1_error)
8494 0 : __Pyx_GOTREF(__pyx_t_1);
8495 0 : __pyx_v_obj = __pyx_t_1;
8496 0 : __pyx_t_1 = 0;
8497 :
8498 : /* "View.MemoryView":428
8499 : * if have_slices:
8500 : * obj = self.is_slice(value)
8501 : * if obj is not None: # <<<<<<<<<<<<<<
8502 : * self.setitem_slice_assignment(self[index], obj)
8503 : * else:
8504 : */
8505 0 : __pyx_t_4 = (__pyx_v_obj != Py_None);
8506 0 : if (__pyx_t_4) {
8507 :
8508 : /* "View.MemoryView":429
8509 : * obj = self.is_slice(value)
8510 : * if obj is not None:
8511 : * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
8512 : * else:
8513 : * self.setitem_slice_assign_scalar(self[index], value)
8514 : */
8515 0 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 429, __pyx_L1_error)
8516 0 : __Pyx_GOTREF(__pyx_t_1);
8517 0 : __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 429, __pyx_L1_error)
8518 0 : __Pyx_GOTREF(__pyx_t_3);
8519 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8520 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8521 :
8522 : /* "View.MemoryView":428
8523 : * if have_slices:
8524 : * obj = self.is_slice(value)
8525 : * if obj is not None: # <<<<<<<<<<<<<<
8526 : * self.setitem_slice_assignment(self[index], obj)
8527 : * else:
8528 : */
8529 0 : goto __pyx_L5;
8530 : }
8531 :
8532 : /* "View.MemoryView":431
8533 : * self.setitem_slice_assignment(self[index], obj)
8534 : * else:
8535 : * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
8536 : * else:
8537 : * self.setitem_indexed(index, value)
8538 : */
8539 : /*else*/ {
8540 0 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 431, __pyx_L1_error)
8541 0 : __Pyx_GOTREF(__pyx_t_3);
8542 0 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 431, __pyx_L1_error)
8543 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 431, __pyx_L1_error)
8544 0 : __Pyx_GOTREF(__pyx_t_1);
8545 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8546 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8547 : }
8548 0 : __pyx_L5:;
8549 :
8550 : /* "View.MemoryView":426
8551 : * have_slices, index = _unellipsify(index, self.view.ndim)
8552 : *
8553 : * if have_slices: # <<<<<<<<<<<<<<
8554 : * obj = self.is_slice(value)
8555 : * if obj is not None:
8556 : */
8557 0 : goto __pyx_L4;
8558 : }
8559 :
8560 : /* "View.MemoryView":433
8561 : * self.setitem_slice_assign_scalar(self[index], value)
8562 : * else:
8563 : * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
8564 : *
8565 : * cdef is_slice(self, obj):
8566 : */
8567 : /*else*/ {
8568 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 433, __pyx_L1_error)
8569 0 : __Pyx_GOTREF(__pyx_t_1);
8570 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8571 : }
8572 0 : __pyx_L4:;
8573 :
8574 : /* "View.MemoryView":420
8575 : * return self.convert_item_to_object(itemp)
8576 : *
8577 : * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8578 : * if self.view.readonly:
8579 : * raise TypeError, "Cannot assign to read-only memoryview"
8580 : */
8581 :
8582 : /* function exit code */
8583 0 : __pyx_r = 0;
8584 0 : goto __pyx_L0;
8585 0 : __pyx_L1_error:;
8586 0 : __Pyx_XDECREF(__pyx_t_1);
8587 0 : __Pyx_XDECREF(__pyx_t_2);
8588 0 : __Pyx_XDECREF(__pyx_t_3);
8589 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8590 0 : __pyx_r = -1;
8591 0 : __pyx_L0:;
8592 0 : __Pyx_XDECREF(__pyx_v_have_slices);
8593 0 : __Pyx_XDECREF(__pyx_v_obj);
8594 0 : __Pyx_XDECREF(__pyx_v_index);
8595 0 : __Pyx_RefNannyFinishContext();
8596 0 : return __pyx_r;
8597 : }
8598 :
8599 : /* "View.MemoryView":435
8600 : * self.setitem_indexed(index, value)
8601 : *
8602 : * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
8603 : * if not isinstance(obj, memoryview):
8604 : * try:
8605 : */
8606 :
8607 0 : static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
8608 0 : PyObject *__pyx_r = NULL;
8609 : __Pyx_RefNannyDeclarations
8610 0 : int __pyx_t_1;
8611 0 : int __pyx_t_2;
8612 0 : PyObject *__pyx_t_3 = NULL;
8613 0 : PyObject *__pyx_t_4 = NULL;
8614 0 : PyObject *__pyx_t_5 = NULL;
8615 0 : PyObject *__pyx_t_6 = NULL;
8616 0 : PyObject *__pyx_t_7 = NULL;
8617 0 : PyObject *__pyx_t_8 = NULL;
8618 0 : int __pyx_t_9;
8619 0 : int __pyx_lineno = 0;
8620 0 : const char *__pyx_filename = NULL;
8621 0 : int __pyx_clineno = 0;
8622 0 : __Pyx_RefNannySetupContext("is_slice", 0);
8623 0 : __Pyx_INCREF(__pyx_v_obj);
8624 :
8625 : /* "View.MemoryView":436
8626 : *
8627 : * cdef is_slice(self, obj):
8628 : * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
8629 : * try:
8630 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8631 : */
8632 0 : __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
8633 0 : __pyx_t_2 = (!__pyx_t_1);
8634 0 : if (__pyx_t_2) {
8635 :
8636 : /* "View.MemoryView":437
8637 : * cdef is_slice(self, obj):
8638 : * if not isinstance(obj, memoryview):
8639 : * try: # <<<<<<<<<<<<<<
8640 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8641 : * self.dtype_is_object)
8642 : */
8643 : {
8644 0 : __Pyx_PyThreadState_declare
8645 0 : __Pyx_PyThreadState_assign
8646 0 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
8647 0 : __Pyx_XGOTREF(__pyx_t_3);
8648 0 : __Pyx_XGOTREF(__pyx_t_4);
8649 0 : __Pyx_XGOTREF(__pyx_t_5);
8650 : /*try:*/ {
8651 :
8652 : /* "View.MemoryView":438
8653 : * if not isinstance(obj, memoryview):
8654 : * try:
8655 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
8656 : * self.dtype_is_object)
8657 : * except TypeError:
8658 : */
8659 0 : __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error)
8660 0 : __Pyx_GOTREF(__pyx_t_6);
8661 :
8662 : /* "View.MemoryView":439
8663 : * try:
8664 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8665 : * self.dtype_is_object) # <<<<<<<<<<<<<<
8666 : * except TypeError:
8667 : * return None
8668 : */
8669 0 : __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L4_error)
8670 0 : __Pyx_GOTREF(__pyx_t_7);
8671 :
8672 : /* "View.MemoryView":438
8673 : * if not isinstance(obj, memoryview):
8674 : * try:
8675 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
8676 : * self.dtype_is_object)
8677 : * except TypeError:
8678 : */
8679 0 : __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 438, __pyx_L4_error)
8680 0 : __Pyx_GOTREF(__pyx_t_8);
8681 0 : __Pyx_INCREF(__pyx_v_obj);
8682 0 : __Pyx_GIVEREF(__pyx_v_obj);
8683 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj)) __PYX_ERR(1, 438, __pyx_L4_error);
8684 0 : __Pyx_GIVEREF(__pyx_t_6);
8685 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error);
8686 0 : __Pyx_GIVEREF(__pyx_t_7);
8687 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error);
8688 0 : __pyx_t_6 = 0;
8689 0 : __pyx_t_7 = 0;
8690 0 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error)
8691 0 : __Pyx_GOTREF(__pyx_t_7);
8692 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8693 0 : __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
8694 0 : __pyx_t_7 = 0;
8695 :
8696 : /* "View.MemoryView":437
8697 : * cdef is_slice(self, obj):
8698 : * if not isinstance(obj, memoryview):
8699 : * try: # <<<<<<<<<<<<<<
8700 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8701 : * self.dtype_is_object)
8702 : */
8703 : }
8704 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8705 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8706 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8707 0 : goto __pyx_L9_try_end;
8708 0 : __pyx_L4_error:;
8709 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8710 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8711 0 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8712 :
8713 : /* "View.MemoryView":440
8714 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8715 : * self.dtype_is_object)
8716 : * except TypeError: # <<<<<<<<<<<<<<
8717 : * return None
8718 : *
8719 : */
8720 0 : __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
8721 0 : if (__pyx_t_9) {
8722 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
8723 0 : if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 440, __pyx_L6_except_error)
8724 0 : __Pyx_XGOTREF(__pyx_t_7);
8725 0 : __Pyx_XGOTREF(__pyx_t_8);
8726 0 : __Pyx_XGOTREF(__pyx_t_6);
8727 :
8728 : /* "View.MemoryView":441
8729 : * self.dtype_is_object)
8730 : * except TypeError:
8731 : * return None # <<<<<<<<<<<<<<
8732 : *
8733 : * return obj
8734 : */
8735 0 : __Pyx_XDECREF(__pyx_r);
8736 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8737 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8738 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8739 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8740 0 : goto __pyx_L7_except_return;
8741 : }
8742 0 : goto __pyx_L6_except_error;
8743 :
8744 : /* "View.MemoryView":437
8745 : * cdef is_slice(self, obj):
8746 : * if not isinstance(obj, memoryview):
8747 : * try: # <<<<<<<<<<<<<<
8748 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8749 : * self.dtype_is_object)
8750 : */
8751 0 : __pyx_L6_except_error:;
8752 0 : __Pyx_XGIVEREF(__pyx_t_3);
8753 0 : __Pyx_XGIVEREF(__pyx_t_4);
8754 0 : __Pyx_XGIVEREF(__pyx_t_5);
8755 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
8756 0 : goto __pyx_L1_error;
8757 0 : __pyx_L7_except_return:;
8758 0 : __Pyx_XGIVEREF(__pyx_t_3);
8759 0 : __Pyx_XGIVEREF(__pyx_t_4);
8760 0 : __Pyx_XGIVEREF(__pyx_t_5);
8761 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
8762 0 : goto __pyx_L0;
8763 0 : __pyx_L9_try_end:;
8764 : }
8765 :
8766 : /* "View.MemoryView":436
8767 : *
8768 : * cdef is_slice(self, obj):
8769 : * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
8770 : * try:
8771 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8772 : */
8773 : }
8774 :
8775 : /* "View.MemoryView":443
8776 : * return None
8777 : *
8778 : * return obj # <<<<<<<<<<<<<<
8779 : *
8780 : * cdef setitem_slice_assignment(self, dst, src):
8781 : */
8782 0 : __Pyx_XDECREF(__pyx_r);
8783 0 : __Pyx_INCREF(__pyx_v_obj);
8784 0 : __pyx_r = __pyx_v_obj;
8785 0 : goto __pyx_L0;
8786 :
8787 : /* "View.MemoryView":435
8788 : * self.setitem_indexed(index, value)
8789 : *
8790 : * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
8791 : * if not isinstance(obj, memoryview):
8792 : * try:
8793 : */
8794 :
8795 : /* function exit code */
8796 0 : __pyx_L1_error:;
8797 0 : __Pyx_XDECREF(__pyx_t_6);
8798 0 : __Pyx_XDECREF(__pyx_t_7);
8799 0 : __Pyx_XDECREF(__pyx_t_8);
8800 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
8801 0 : __pyx_r = 0;
8802 0 : __pyx_L0:;
8803 0 : __Pyx_XDECREF(__pyx_v_obj);
8804 0 : __Pyx_XGIVEREF(__pyx_r);
8805 0 : __Pyx_RefNannyFinishContext();
8806 0 : return __pyx_r;
8807 : }
8808 :
8809 : /* "View.MemoryView":445
8810 : * return obj
8811 : *
8812 : * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
8813 : * cdef __Pyx_memviewslice dst_slice
8814 : * cdef __Pyx_memviewslice src_slice
8815 : */
8816 :
8817 0 : static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
8818 0 : __Pyx_memviewslice __pyx_v_dst_slice;
8819 0 : __Pyx_memviewslice __pyx_v_src_slice;
8820 0 : __Pyx_memviewslice __pyx_v_msrc;
8821 0 : __Pyx_memviewslice __pyx_v_mdst;
8822 0 : PyObject *__pyx_r = NULL;
8823 : __Pyx_RefNannyDeclarations
8824 0 : __Pyx_memviewslice *__pyx_t_1;
8825 0 : PyObject *__pyx_t_2 = NULL;
8826 0 : int __pyx_t_3;
8827 0 : int __pyx_t_4;
8828 0 : int __pyx_t_5;
8829 0 : int __pyx_lineno = 0;
8830 0 : const char *__pyx_filename = NULL;
8831 0 : int __pyx_clineno = 0;
8832 0 : __Pyx_RefNannySetupContext("setitem_slice_assignment", 1);
8833 :
8834 : /* "View.MemoryView":448
8835 : * cdef __Pyx_memviewslice dst_slice
8836 : * cdef __Pyx_memviewslice src_slice
8837 : * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<<
8838 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
8839 : *
8840 : */
8841 0 : if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
8842 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
8843 0 : __pyx_v_msrc = (__pyx_t_1[0]);
8844 :
8845 : /* "View.MemoryView":449
8846 : * cdef __Pyx_memviewslice src_slice
8847 : * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
8848 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<<
8849 : *
8850 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
8851 : */
8852 0 : if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 449, __pyx_L1_error)
8853 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 449, __pyx_L1_error)
8854 0 : __pyx_v_mdst = (__pyx_t_1[0]);
8855 :
8856 : /* "View.MemoryView":451
8857 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
8858 : *
8859 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
8860 : *
8861 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
8862 : */
8863 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
8864 0 : __Pyx_GOTREF(__pyx_t_2);
8865 0 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
8866 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8867 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
8868 0 : __Pyx_GOTREF(__pyx_t_2);
8869 0 : __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
8870 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8871 0 : __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 451, __pyx_L1_error)
8872 :
8873 : /* "View.MemoryView":445
8874 : * return obj
8875 : *
8876 : * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
8877 : * cdef __Pyx_memviewslice dst_slice
8878 : * cdef __Pyx_memviewslice src_slice
8879 : */
8880 :
8881 : /* function exit code */
8882 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8883 0 : goto __pyx_L0;
8884 0 : __pyx_L1_error:;
8885 0 : __Pyx_XDECREF(__pyx_t_2);
8886 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
8887 0 : __pyx_r = 0;
8888 0 : __pyx_L0:;
8889 0 : __Pyx_XGIVEREF(__pyx_r);
8890 0 : __Pyx_RefNannyFinishContext();
8891 0 : return __pyx_r;
8892 : }
8893 :
8894 : /* "View.MemoryView":453
8895 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
8896 : *
8897 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
8898 : * cdef int array[128]
8899 : * cdef void *tmp = NULL
8900 : */
8901 :
8902 0 : static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
8903 0 : int __pyx_v_array[0x80];
8904 0 : void *__pyx_v_tmp;
8905 0 : void *__pyx_v_item;
8906 0 : __Pyx_memviewslice *__pyx_v_dst_slice;
8907 0 : __Pyx_memviewslice __pyx_v_tmp_slice;
8908 0 : PyObject *__pyx_r = NULL;
8909 : __Pyx_RefNannyDeclarations
8910 0 : __Pyx_memviewslice *__pyx_t_1;
8911 0 : int __pyx_t_2;
8912 0 : PyObject *__pyx_t_3 = NULL;
8913 0 : int __pyx_t_4;
8914 0 : int __pyx_t_5;
8915 0 : char const *__pyx_t_6;
8916 0 : PyObject *__pyx_t_7 = NULL;
8917 0 : PyObject *__pyx_t_8 = NULL;
8918 0 : PyObject *__pyx_t_9 = NULL;
8919 0 : PyObject *__pyx_t_10 = NULL;
8920 0 : PyObject *__pyx_t_11 = NULL;
8921 0 : PyObject *__pyx_t_12 = NULL;
8922 0 : int __pyx_lineno = 0;
8923 0 : const char *__pyx_filename = NULL;
8924 0 : int __pyx_clineno = 0;
8925 0 : __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 1);
8926 :
8927 : /* "View.MemoryView":455
8928 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
8929 : * cdef int array[128]
8930 : * cdef void *tmp = NULL # <<<<<<<<<<<<<<
8931 : * cdef void *item
8932 : *
8933 : */
8934 0 : __pyx_v_tmp = NULL;
8935 :
8936 : /* "View.MemoryView":460
8937 : * cdef __Pyx_memviewslice *dst_slice
8938 : * cdef __Pyx_memviewslice tmp_slice
8939 : * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
8940 : *
8941 : * if <size_t>self.view.itemsize > sizeof(array):
8942 : */
8943 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 460, __pyx_L1_error)
8944 0 : __pyx_v_dst_slice = __pyx_t_1;
8945 :
8946 : /* "View.MemoryView":462
8947 : * dst_slice = get_slice_from_memview(dst, &tmp_slice)
8948 : *
8949 : * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
8950 : * tmp = PyMem_Malloc(self.view.itemsize)
8951 : * if tmp == NULL:
8952 : */
8953 0 : __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
8954 0 : if (__pyx_t_2) {
8955 :
8956 : /* "View.MemoryView":463
8957 : *
8958 : * if <size_t>self.view.itemsize > sizeof(array):
8959 : * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
8960 : * if tmp == NULL:
8961 : * raise MemoryError
8962 : */
8963 0 : __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
8964 :
8965 : /* "View.MemoryView":464
8966 : * if <size_t>self.view.itemsize > sizeof(array):
8967 : * tmp = PyMem_Malloc(self.view.itemsize)
8968 : * if tmp == NULL: # <<<<<<<<<<<<<<
8969 : * raise MemoryError
8970 : * item = tmp
8971 : */
8972 0 : __pyx_t_2 = (__pyx_v_tmp == NULL);
8973 0 : if (unlikely(__pyx_t_2)) {
8974 :
8975 : /* "View.MemoryView":465
8976 : * tmp = PyMem_Malloc(self.view.itemsize)
8977 : * if tmp == NULL:
8978 : * raise MemoryError # <<<<<<<<<<<<<<
8979 : * item = tmp
8980 : * else:
8981 : */
8982 0 : PyErr_NoMemory(); __PYX_ERR(1, 465, __pyx_L1_error)
8983 :
8984 : /* "View.MemoryView":464
8985 : * if <size_t>self.view.itemsize > sizeof(array):
8986 : * tmp = PyMem_Malloc(self.view.itemsize)
8987 : * if tmp == NULL: # <<<<<<<<<<<<<<
8988 : * raise MemoryError
8989 : * item = tmp
8990 : */
8991 : }
8992 :
8993 : /* "View.MemoryView":466
8994 : * if tmp == NULL:
8995 : * raise MemoryError
8996 : * item = tmp # <<<<<<<<<<<<<<
8997 : * else:
8998 : * item = <void *> array
8999 : */
9000 0 : __pyx_v_item = __pyx_v_tmp;
9001 :
9002 : /* "View.MemoryView":462
9003 : * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9004 : *
9005 : * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9006 : * tmp = PyMem_Malloc(self.view.itemsize)
9007 : * if tmp == NULL:
9008 : */
9009 0 : goto __pyx_L3;
9010 : }
9011 :
9012 : /* "View.MemoryView":468
9013 : * item = tmp
9014 : * else:
9015 : * item = <void *> array # <<<<<<<<<<<<<<
9016 : *
9017 : * try:
9018 : */
9019 : /*else*/ {
9020 : __pyx_v_item = ((void *)__pyx_v_array);
9021 : }
9022 0 : __pyx_L3:;
9023 :
9024 : /* "View.MemoryView":470
9025 : * item = <void *> array
9026 : *
9027 : * try: # <<<<<<<<<<<<<<
9028 : * if self.dtype_is_object:
9029 : * (<PyObject **> item)[0] = <PyObject *> value
9030 : */
9031 : /*try:*/ {
9032 :
9033 : /* "View.MemoryView":471
9034 : *
9035 : * try:
9036 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
9037 : * (<PyObject **> item)[0] = <PyObject *> value
9038 : * else:
9039 : */
9040 0 : if (__pyx_v_self->dtype_is_object) {
9041 :
9042 : /* "View.MemoryView":472
9043 : * try:
9044 : * if self.dtype_is_object:
9045 : * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
9046 : * else:
9047 : * self.assign_item_from_object(<char *> item, value)
9048 : */
9049 0 : (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9050 :
9051 : /* "View.MemoryView":471
9052 : *
9053 : * try:
9054 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
9055 : * (<PyObject **> item)[0] = <PyObject *> value
9056 : * else:
9057 : */
9058 0 : goto __pyx_L8;
9059 : }
9060 :
9061 : /* "View.MemoryView":474
9062 : * (<PyObject **> item)[0] = <PyObject *> value
9063 : * else:
9064 : * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
9065 : *
9066 : *
9067 : */
9068 : /*else*/ {
9069 0 : __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 474, __pyx_L6_error)
9070 0 : __Pyx_GOTREF(__pyx_t_3);
9071 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9072 : }
9073 0 : __pyx_L8:;
9074 :
9075 : /* "View.MemoryView":478
9076 : *
9077 : *
9078 : * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9079 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9080 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9081 : */
9082 0 : __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
9083 0 : if (__pyx_t_2) {
9084 :
9085 : /* "View.MemoryView":479
9086 : *
9087 : * if self.view.suboffsets != NULL:
9088 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
9089 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9090 : * item, self.dtype_is_object)
9091 : */
9092 0 : __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 479, __pyx_L6_error)
9093 :
9094 : /* "View.MemoryView":478
9095 : *
9096 : *
9097 : * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9098 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9099 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9100 : */
9101 : }
9102 :
9103 : /* "View.MemoryView":480
9104 : * if self.view.suboffsets != NULL:
9105 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9106 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
9107 : * item, self.dtype_is_object)
9108 : * finally:
9109 : */
9110 0 : __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
9111 : }
9112 :
9113 : /* "View.MemoryView":483
9114 : * item, self.dtype_is_object)
9115 : * finally:
9116 : * PyMem_Free(tmp) # <<<<<<<<<<<<<<
9117 : *
9118 : * cdef setitem_indexed(self, index, value):
9119 : */
9120 : /*finally:*/ {
9121 : /*normal exit:*/{
9122 0 : PyMem_Free(__pyx_v_tmp);
9123 0 : goto __pyx_L7;
9124 : }
9125 0 : __pyx_L6_error:;
9126 : /*exception exit:*/{
9127 0 : __Pyx_PyThreadState_declare
9128 0 : __Pyx_PyThreadState_assign
9129 0 : __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9130 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9131 0 : if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9132 0 : if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
9133 0 : __Pyx_XGOTREF(__pyx_t_7);
9134 0 : __Pyx_XGOTREF(__pyx_t_8);
9135 0 : __Pyx_XGOTREF(__pyx_t_9);
9136 0 : __Pyx_XGOTREF(__pyx_t_10);
9137 0 : __Pyx_XGOTREF(__pyx_t_11);
9138 0 : __Pyx_XGOTREF(__pyx_t_12);
9139 0 : __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9140 : {
9141 0 : PyMem_Free(__pyx_v_tmp);
9142 : }
9143 0 : if (PY_MAJOR_VERSION >= 3) {
9144 0 : __Pyx_XGIVEREF(__pyx_t_10);
9145 0 : __Pyx_XGIVEREF(__pyx_t_11);
9146 0 : __Pyx_XGIVEREF(__pyx_t_12);
9147 0 : __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9148 : }
9149 0 : __Pyx_XGIVEREF(__pyx_t_7);
9150 0 : __Pyx_XGIVEREF(__pyx_t_8);
9151 0 : __Pyx_XGIVEREF(__pyx_t_9);
9152 0 : __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9153 0 : __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9154 0 : __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9155 0 : goto __pyx_L1_error;
9156 : }
9157 0 : __pyx_L7:;
9158 : }
9159 :
9160 : /* "View.MemoryView":453
9161 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9162 : *
9163 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9164 : * cdef int array[128]
9165 : * cdef void *tmp = NULL
9166 : */
9167 :
9168 : /* function exit code */
9169 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9170 0 : goto __pyx_L0;
9171 0 : __pyx_L1_error:;
9172 0 : __Pyx_XDECREF(__pyx_t_3);
9173 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9174 0 : __pyx_r = 0;
9175 0 : __pyx_L0:;
9176 0 : __Pyx_XGIVEREF(__pyx_r);
9177 0 : __Pyx_RefNannyFinishContext();
9178 0 : return __pyx_r;
9179 : }
9180 :
9181 : /* "View.MemoryView":485
9182 : * PyMem_Free(tmp)
9183 : *
9184 : * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
9185 : * cdef char *itemp = self.get_item_pointer(index)
9186 : * self.assign_item_from_object(itemp, value)
9187 : */
9188 :
9189 0 : static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9190 0 : char *__pyx_v_itemp;
9191 0 : PyObject *__pyx_r = NULL;
9192 : __Pyx_RefNannyDeclarations
9193 0 : char *__pyx_t_1;
9194 0 : PyObject *__pyx_t_2 = NULL;
9195 0 : int __pyx_lineno = 0;
9196 0 : const char *__pyx_filename = NULL;
9197 0 : int __pyx_clineno = 0;
9198 0 : __Pyx_RefNannySetupContext("setitem_indexed", 1);
9199 :
9200 : /* "View.MemoryView":486
9201 : *
9202 : * cdef setitem_indexed(self, index, value):
9203 : * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
9204 : * self.assign_item_from_object(itemp, value)
9205 : *
9206 : */
9207 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 486, __pyx_L1_error)
9208 0 : __pyx_v_itemp = __pyx_t_1;
9209 :
9210 : /* "View.MemoryView":487
9211 : * cdef setitem_indexed(self, index, value):
9212 : * cdef char *itemp = self.get_item_pointer(index)
9213 : * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9214 : *
9215 : * cdef convert_item_to_object(self, char *itemp):
9216 : */
9217 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 487, __pyx_L1_error)
9218 0 : __Pyx_GOTREF(__pyx_t_2);
9219 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9220 :
9221 : /* "View.MemoryView":485
9222 : * PyMem_Free(tmp)
9223 : *
9224 : * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
9225 : * cdef char *itemp = self.get_item_pointer(index)
9226 : * self.assign_item_from_object(itemp, value)
9227 : */
9228 :
9229 : /* function exit code */
9230 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9231 0 : goto __pyx_L0;
9232 0 : __pyx_L1_error:;
9233 0 : __Pyx_XDECREF(__pyx_t_2);
9234 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9235 0 : __pyx_r = 0;
9236 0 : __pyx_L0:;
9237 0 : __Pyx_XGIVEREF(__pyx_r);
9238 0 : __Pyx_RefNannyFinishContext();
9239 0 : return __pyx_r;
9240 : }
9241 :
9242 : /* "View.MemoryView":489
9243 : * self.assign_item_from_object(itemp, value)
9244 : *
9245 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9246 : * """Only used if instantiated manually by the user, or if Cython doesn't
9247 : * know how to convert the type"""
9248 : */
9249 :
9250 0 : static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
9251 0 : PyObject *__pyx_v_struct = NULL;
9252 0 : PyObject *__pyx_v_bytesitem = 0;
9253 0 : PyObject *__pyx_v_result = NULL;
9254 0 : PyObject *__pyx_r = NULL;
9255 : __Pyx_RefNannyDeclarations
9256 0 : PyObject *__pyx_t_1 = NULL;
9257 0 : PyObject *__pyx_t_2 = NULL;
9258 0 : PyObject *__pyx_t_3 = NULL;
9259 0 : PyObject *__pyx_t_4 = NULL;
9260 0 : PyObject *__pyx_t_5 = NULL;
9261 0 : PyObject *__pyx_t_6 = NULL;
9262 0 : PyObject *__pyx_t_7 = NULL;
9263 0 : unsigned int __pyx_t_8;
9264 0 : Py_ssize_t __pyx_t_9;
9265 0 : int __pyx_t_10;
9266 0 : int __pyx_t_11;
9267 0 : int __pyx_lineno = 0;
9268 0 : const char *__pyx_filename = NULL;
9269 0 : int __pyx_clineno = 0;
9270 0 : __Pyx_RefNannySetupContext("convert_item_to_object", 1);
9271 :
9272 : /* "View.MemoryView":492
9273 : * """Only used if instantiated manually by the user, or if Cython doesn't
9274 : * know how to convert the type"""
9275 : * import struct # <<<<<<<<<<<<<<
9276 : * cdef bytes bytesitem
9277 : *
9278 : */
9279 0 : __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 492, __pyx_L1_error)
9280 0 : __Pyx_GOTREF(__pyx_t_1);
9281 0 : __pyx_v_struct = __pyx_t_1;
9282 0 : __pyx_t_1 = 0;
9283 :
9284 : /* "View.MemoryView":495
9285 : * cdef bytes bytesitem
9286 : *
9287 : * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
9288 : * try:
9289 : * result = struct.unpack(self.view.format, bytesitem)
9290 : */
9291 0 : __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L1_error)
9292 0 : __Pyx_GOTREF(__pyx_t_1);
9293 0 : __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
9294 0 : __pyx_t_1 = 0;
9295 :
9296 : /* "View.MemoryView":496
9297 : *
9298 : * bytesitem = itemp[:self.view.itemsize]
9299 : * try: # <<<<<<<<<<<<<<
9300 : * result = struct.unpack(self.view.format, bytesitem)
9301 : * except struct.error:
9302 : */
9303 : {
9304 0 : __Pyx_PyThreadState_declare
9305 0 : __Pyx_PyThreadState_assign
9306 0 : __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
9307 0 : __Pyx_XGOTREF(__pyx_t_2);
9308 0 : __Pyx_XGOTREF(__pyx_t_3);
9309 0 : __Pyx_XGOTREF(__pyx_t_4);
9310 : /*try:*/ {
9311 :
9312 : /* "View.MemoryView":497
9313 : * bytesitem = itemp[:self.view.itemsize]
9314 : * try:
9315 : * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
9316 : * except struct.error:
9317 : * raise ValueError, "Unable to convert item to object"
9318 : */
9319 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 497, __pyx_L3_error)
9320 0 : __Pyx_GOTREF(__pyx_t_5);
9321 0 : __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L3_error)
9322 0 : __Pyx_GOTREF(__pyx_t_6);
9323 0 : __pyx_t_7 = NULL;
9324 0 : __pyx_t_8 = 0;
9325 : #if CYTHON_UNPACK_METHODS
9326 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
9327 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
9328 0 : if (likely(__pyx_t_7)) {
9329 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9330 0 : __Pyx_INCREF(__pyx_t_7);
9331 0 : __Pyx_INCREF(function);
9332 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
9333 : __pyx_t_8 = 1;
9334 : }
9335 : }
9336 : #endif
9337 : {
9338 0 : PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
9339 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
9340 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9341 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9342 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 497, __pyx_L3_error)
9343 0 : __Pyx_GOTREF(__pyx_t_1);
9344 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9345 : }
9346 0 : __pyx_v_result = __pyx_t_1;
9347 0 : __pyx_t_1 = 0;
9348 :
9349 : /* "View.MemoryView":496
9350 : *
9351 : * bytesitem = itemp[:self.view.itemsize]
9352 : * try: # <<<<<<<<<<<<<<
9353 : * result = struct.unpack(self.view.format, bytesitem)
9354 : * except struct.error:
9355 : */
9356 : }
9357 :
9358 : /* "View.MemoryView":501
9359 : * raise ValueError, "Unable to convert item to object"
9360 : * else:
9361 : * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9362 : * return result[0]
9363 : * return result
9364 : */
9365 : /*else:*/ {
9366 0 : __pyx_t_9 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(1, 501, __pyx_L5_except_error)
9367 0 : __pyx_t_10 = (__pyx_t_9 == 1);
9368 0 : if (__pyx_t_10) {
9369 :
9370 : /* "View.MemoryView":502
9371 : * else:
9372 : * if len(self.view.format) == 1:
9373 : * return result[0] # <<<<<<<<<<<<<<
9374 : * return result
9375 : *
9376 : */
9377 0 : __Pyx_XDECREF(__pyx_r);
9378 0 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 502, __pyx_L5_except_error)
9379 0 : __Pyx_GOTREF(__pyx_t_1);
9380 0 : __pyx_r = __pyx_t_1;
9381 0 : __pyx_t_1 = 0;
9382 0 : goto __pyx_L6_except_return;
9383 :
9384 : /* "View.MemoryView":501
9385 : * raise ValueError, "Unable to convert item to object"
9386 : * else:
9387 : * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9388 : * return result[0]
9389 : * return result
9390 : */
9391 : }
9392 :
9393 : /* "View.MemoryView":503
9394 : * if len(self.view.format) == 1:
9395 : * return result[0]
9396 : * return result # <<<<<<<<<<<<<<
9397 : *
9398 : * cdef assign_item_from_object(self, char *itemp, object value):
9399 : */
9400 0 : __Pyx_XDECREF(__pyx_r);
9401 0 : __Pyx_INCREF(__pyx_v_result);
9402 0 : __pyx_r = __pyx_v_result;
9403 0 : goto __pyx_L6_except_return;
9404 : }
9405 0 : __pyx_L3_error:;
9406 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9407 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9408 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9409 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9410 :
9411 : /* "View.MemoryView":498
9412 : * try:
9413 : * result = struct.unpack(self.view.format, bytesitem)
9414 : * except struct.error: # <<<<<<<<<<<<<<
9415 : * raise ValueError, "Unable to convert item to object"
9416 : * else:
9417 : */
9418 0 : __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6);
9419 0 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 498, __pyx_L5_except_error)
9420 0 : __Pyx_GOTREF(__pyx_t_7);
9421 0 : __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7);
9422 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9423 0 : __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_6);
9424 0 : __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
9425 0 : if (__pyx_t_11) {
9426 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9427 0 : if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 498, __pyx_L5_except_error)
9428 0 : __Pyx_XGOTREF(__pyx_t_6);
9429 0 : __Pyx_XGOTREF(__pyx_t_5);
9430 0 : __Pyx_XGOTREF(__pyx_t_1);
9431 :
9432 : /* "View.MemoryView":499
9433 : * result = struct.unpack(self.view.format, bytesitem)
9434 : * except struct.error:
9435 : * raise ValueError, "Unable to convert item to object" # <<<<<<<<<<<<<<
9436 : * else:
9437 : * if len(self.view.format) == 1:
9438 : */
9439 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Unable_to_convert_item_to_object, 0, 0);
9440 0 : __PYX_ERR(1, 499, __pyx_L5_except_error)
9441 : }
9442 0 : goto __pyx_L5_except_error;
9443 :
9444 : /* "View.MemoryView":496
9445 : *
9446 : * bytesitem = itemp[:self.view.itemsize]
9447 : * try: # <<<<<<<<<<<<<<
9448 : * result = struct.unpack(self.view.format, bytesitem)
9449 : * except struct.error:
9450 : */
9451 0 : __pyx_L5_except_error:;
9452 0 : __Pyx_XGIVEREF(__pyx_t_2);
9453 0 : __Pyx_XGIVEREF(__pyx_t_3);
9454 0 : __Pyx_XGIVEREF(__pyx_t_4);
9455 0 : __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9456 0 : goto __pyx_L1_error;
9457 0 : __pyx_L6_except_return:;
9458 0 : __Pyx_XGIVEREF(__pyx_t_2);
9459 0 : __Pyx_XGIVEREF(__pyx_t_3);
9460 0 : __Pyx_XGIVEREF(__pyx_t_4);
9461 0 : __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9462 0 : goto __pyx_L0;
9463 : }
9464 :
9465 : /* "View.MemoryView":489
9466 : * self.assign_item_from_object(itemp, value)
9467 : *
9468 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9469 : * """Only used if instantiated manually by the user, or if Cython doesn't
9470 : * know how to convert the type"""
9471 : */
9472 :
9473 : /* function exit code */
9474 0 : __pyx_L1_error:;
9475 0 : __Pyx_XDECREF(__pyx_t_1);
9476 0 : __Pyx_XDECREF(__pyx_t_5);
9477 0 : __Pyx_XDECREF(__pyx_t_6);
9478 0 : __Pyx_XDECREF(__pyx_t_7);
9479 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9480 0 : __pyx_r = 0;
9481 0 : __pyx_L0:;
9482 0 : __Pyx_XDECREF(__pyx_v_struct);
9483 0 : __Pyx_XDECREF(__pyx_v_bytesitem);
9484 0 : __Pyx_XDECREF(__pyx_v_result);
9485 0 : __Pyx_XGIVEREF(__pyx_r);
9486 0 : __Pyx_RefNannyFinishContext();
9487 0 : return __pyx_r;
9488 : }
9489 :
9490 : /* "View.MemoryView":505
9491 : * return result
9492 : *
9493 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9494 : * """Only used if instantiated manually by the user, or if Cython doesn't
9495 : * know how to convert the type"""
9496 : */
9497 :
9498 0 : static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
9499 0 : PyObject *__pyx_v_struct = NULL;
9500 0 : char __pyx_v_c;
9501 0 : PyObject *__pyx_v_bytesvalue = 0;
9502 0 : Py_ssize_t __pyx_v_i;
9503 0 : PyObject *__pyx_r = NULL;
9504 : __Pyx_RefNannyDeclarations
9505 0 : PyObject *__pyx_t_1 = NULL;
9506 0 : int __pyx_t_2;
9507 0 : PyObject *__pyx_t_3 = NULL;
9508 0 : PyObject *__pyx_t_4 = NULL;
9509 0 : PyObject *__pyx_t_5 = NULL;
9510 0 : unsigned int __pyx_t_6;
9511 0 : Py_ssize_t __pyx_t_7;
9512 0 : PyObject *__pyx_t_8 = NULL;
9513 0 : char *__pyx_t_9;
9514 0 : char *__pyx_t_10;
9515 0 : char *__pyx_t_11;
9516 0 : char *__pyx_t_12;
9517 0 : int __pyx_lineno = 0;
9518 0 : const char *__pyx_filename = NULL;
9519 0 : int __pyx_clineno = 0;
9520 0 : __Pyx_RefNannySetupContext("assign_item_from_object", 1);
9521 :
9522 : /* "View.MemoryView":508
9523 : * """Only used if instantiated manually by the user, or if Cython doesn't
9524 : * know how to convert the type"""
9525 : * import struct # <<<<<<<<<<<<<<
9526 : * cdef char c
9527 : * cdef bytes bytesvalue
9528 : */
9529 0 : __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
9530 0 : __Pyx_GOTREF(__pyx_t_1);
9531 0 : __pyx_v_struct = __pyx_t_1;
9532 0 : __pyx_t_1 = 0;
9533 :
9534 : /* "View.MemoryView":513
9535 : * cdef Py_ssize_t i
9536 : *
9537 : * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9538 : * bytesvalue = struct.pack(self.view.format, *value)
9539 : * else:
9540 : */
9541 0 : __pyx_t_2 = PyTuple_Check(__pyx_v_value);
9542 0 : if (__pyx_t_2) {
9543 :
9544 : /* "View.MemoryView":514
9545 : *
9546 : * if isinstance(value, tuple):
9547 : * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
9548 : * else:
9549 : * bytesvalue = struct.pack(self.view.format, value)
9550 : */
9551 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
9552 0 : __Pyx_GOTREF(__pyx_t_1);
9553 0 : __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
9554 0 : __Pyx_GOTREF(__pyx_t_3);
9555 0 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
9556 0 : __Pyx_GOTREF(__pyx_t_4);
9557 0 : __Pyx_GIVEREF(__pyx_t_3);
9558 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error);
9559 0 : __pyx_t_3 = 0;
9560 0 : __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
9561 0 : __Pyx_GOTREF(__pyx_t_3);
9562 0 : __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 514, __pyx_L1_error)
9563 0 : __Pyx_GOTREF(__pyx_t_5);
9564 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9565 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9566 0 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
9567 0 : __Pyx_GOTREF(__pyx_t_3);
9568 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9569 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9570 0 : if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 514, __pyx_L1_error)
9571 0 : __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
9572 0 : __pyx_t_3 = 0;
9573 :
9574 : /* "View.MemoryView":513
9575 : * cdef Py_ssize_t i
9576 : *
9577 : * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9578 : * bytesvalue = struct.pack(self.view.format, *value)
9579 : * else:
9580 : */
9581 0 : goto __pyx_L3;
9582 : }
9583 :
9584 : /* "View.MemoryView":516
9585 : * bytesvalue = struct.pack(self.view.format, *value)
9586 : * else:
9587 : * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
9588 : *
9589 : * for i, c in enumerate(bytesvalue):
9590 : */
9591 : /*else*/ {
9592 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 516, __pyx_L1_error)
9593 0 : __Pyx_GOTREF(__pyx_t_5);
9594 0 : __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 516, __pyx_L1_error)
9595 0 : __Pyx_GOTREF(__pyx_t_1);
9596 0 : __pyx_t_4 = NULL;
9597 0 : __pyx_t_6 = 0;
9598 : #if CYTHON_UNPACK_METHODS
9599 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
9600 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
9601 0 : if (likely(__pyx_t_4)) {
9602 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9603 0 : __Pyx_INCREF(__pyx_t_4);
9604 0 : __Pyx_INCREF(function);
9605 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
9606 : __pyx_t_6 = 1;
9607 : }
9608 : }
9609 : #endif
9610 : {
9611 0 : PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_1, __pyx_v_value};
9612 0 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
9613 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9614 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9615 0 : if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
9616 0 : __Pyx_GOTREF(__pyx_t_3);
9617 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9618 : }
9619 0 : if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 516, __pyx_L1_error)
9620 : __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
9621 : __pyx_t_3 = 0;
9622 : }
9623 0 : __pyx_L3:;
9624 :
9625 : /* "View.MemoryView":518
9626 : * bytesvalue = struct.pack(self.view.format, value)
9627 : *
9628 : * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
9629 : * itemp[i] = c
9630 : *
9631 : */
9632 0 : __pyx_t_7 = 0;
9633 0 : if (unlikely(__pyx_v_bytesvalue == Py_None)) {
9634 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
9635 0 : __PYX_ERR(1, 518, __pyx_L1_error)
9636 : }
9637 0 : __Pyx_INCREF(__pyx_v_bytesvalue);
9638 0 : __pyx_t_8 = __pyx_v_bytesvalue;
9639 0 : __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8);
9640 0 : __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8));
9641 0 : for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) {
9642 0 : __pyx_t_9 = __pyx_t_12;
9643 0 : __pyx_v_c = (__pyx_t_9[0]);
9644 :
9645 : /* "View.MemoryView":519
9646 : *
9647 : * for i, c in enumerate(bytesvalue):
9648 : * itemp[i] = c # <<<<<<<<<<<<<<
9649 : *
9650 : * @cname('getbuffer')
9651 : */
9652 0 : __pyx_v_i = __pyx_t_7;
9653 :
9654 : /* "View.MemoryView":518
9655 : * bytesvalue = struct.pack(self.view.format, value)
9656 : *
9657 : * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
9658 : * itemp[i] = c
9659 : *
9660 : */
9661 0 : __pyx_t_7 = (__pyx_t_7 + 1);
9662 :
9663 : /* "View.MemoryView":519
9664 : *
9665 : * for i, c in enumerate(bytesvalue):
9666 : * itemp[i] = c # <<<<<<<<<<<<<<
9667 : *
9668 : * @cname('getbuffer')
9669 : */
9670 0 : (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
9671 : }
9672 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9673 :
9674 : /* "View.MemoryView":505
9675 : * return result
9676 : *
9677 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9678 : * """Only used if instantiated manually by the user, or if Cython doesn't
9679 : * know how to convert the type"""
9680 : */
9681 :
9682 : /* function exit code */
9683 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9684 0 : goto __pyx_L0;
9685 0 : __pyx_L1_error:;
9686 0 : __Pyx_XDECREF(__pyx_t_1);
9687 0 : __Pyx_XDECREF(__pyx_t_3);
9688 0 : __Pyx_XDECREF(__pyx_t_4);
9689 0 : __Pyx_XDECREF(__pyx_t_5);
9690 0 : __Pyx_XDECREF(__pyx_t_8);
9691 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9692 0 : __pyx_r = 0;
9693 0 : __pyx_L0:;
9694 0 : __Pyx_XDECREF(__pyx_v_struct);
9695 0 : __Pyx_XDECREF(__pyx_v_bytesvalue);
9696 0 : __Pyx_XGIVEREF(__pyx_r);
9697 0 : __Pyx_RefNannyFinishContext();
9698 0 : return __pyx_r;
9699 : }
9700 :
9701 : /* "View.MemoryView":521
9702 : * itemp[i] = c
9703 : *
9704 : * @cname('getbuffer') # <<<<<<<<<<<<<<
9705 : * def __getbuffer__(self, Py_buffer *info, int flags):
9706 : * if flags & PyBUF_WRITABLE and self.view.readonly:
9707 : */
9708 :
9709 : /* Python wrapper */
9710 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9711 203 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9712 203 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9713 203 : int __pyx_r;
9714 : __Pyx_RefNannyDeclarations
9715 203 : __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9716 203 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
9717 203 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
9718 :
9719 : /* function exit code */
9720 203 : __Pyx_RefNannyFinishContext();
9721 203 : return __pyx_r;
9722 : }
9723 :
9724 203 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9725 203 : int __pyx_r;
9726 : __Pyx_RefNannyDeclarations
9727 203 : int __pyx_t_1;
9728 203 : int __pyx_t_2;
9729 203 : Py_ssize_t *__pyx_t_3;
9730 203 : char *__pyx_t_4;
9731 203 : void *__pyx_t_5;
9732 203 : int __pyx_t_6;
9733 203 : Py_ssize_t __pyx_t_7;
9734 203 : int __pyx_lineno = 0;
9735 203 : const char *__pyx_filename = NULL;
9736 203 : int __pyx_clineno = 0;
9737 203 : if (unlikely(__pyx_v_info == NULL)) {
9738 0 : PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9739 0 : return -1;
9740 : }
9741 203 : __Pyx_RefNannySetupContext("__getbuffer__", 0);
9742 203 : __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9743 203 : __Pyx_GIVEREF(__pyx_v_info->obj);
9744 :
9745 : /* "View.MemoryView":523
9746 : * @cname('getbuffer')
9747 : * def __getbuffer__(self, Py_buffer *info, int flags):
9748 : * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
9749 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
9750 : *
9751 : */
9752 203 : __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
9753 203 : if (__pyx_t_2) {
9754 0 : } else {
9755 203 : __pyx_t_1 = __pyx_t_2;
9756 203 : goto __pyx_L4_bool_binop_done;
9757 : }
9758 0 : __pyx_t_1 = __pyx_v_self->view.readonly;
9759 203 : __pyx_L4_bool_binop_done:;
9760 203 : if (unlikely(__pyx_t_1)) {
9761 :
9762 : /* "View.MemoryView":524
9763 : * def __getbuffer__(self, Py_buffer *info, int flags):
9764 : * if flags & PyBUF_WRITABLE and self.view.readonly:
9765 : * raise ValueError, "Cannot create writable memory view from read-only memoryview" # <<<<<<<<<<<<<<
9766 : *
9767 : * if flags & PyBUF_ND:
9768 : */
9769 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Cannot_create_writable_memory_vi, 0, 0);
9770 0 : __PYX_ERR(1, 524, __pyx_L1_error)
9771 :
9772 : /* "View.MemoryView":523
9773 : * @cname('getbuffer')
9774 : * def __getbuffer__(self, Py_buffer *info, int flags):
9775 : * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
9776 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
9777 : *
9778 : */
9779 : }
9780 :
9781 : /* "View.MemoryView":526
9782 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
9783 : *
9784 : * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
9785 : * info.shape = self.view.shape
9786 : * else:
9787 : */
9788 203 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
9789 203 : if (__pyx_t_1) {
9790 :
9791 : /* "View.MemoryView":527
9792 : *
9793 : * if flags & PyBUF_ND:
9794 : * info.shape = self.view.shape # <<<<<<<<<<<<<<
9795 : * else:
9796 : * info.shape = NULL
9797 : */
9798 203 : __pyx_t_3 = __pyx_v_self->view.shape;
9799 203 : __pyx_v_info->shape = __pyx_t_3;
9800 :
9801 : /* "View.MemoryView":526
9802 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
9803 : *
9804 : * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
9805 : * info.shape = self.view.shape
9806 : * else:
9807 : */
9808 203 : goto __pyx_L6;
9809 : }
9810 :
9811 : /* "View.MemoryView":529
9812 : * info.shape = self.view.shape
9813 : * else:
9814 : * info.shape = NULL # <<<<<<<<<<<<<<
9815 : *
9816 : * if flags & PyBUF_STRIDES:
9817 : */
9818 : /*else*/ {
9819 0 : __pyx_v_info->shape = NULL;
9820 : }
9821 203 : __pyx_L6:;
9822 :
9823 : /* "View.MemoryView":531
9824 : * info.shape = NULL
9825 : *
9826 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
9827 : * info.strides = self.view.strides
9828 : * else:
9829 : */
9830 203 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
9831 203 : if (__pyx_t_1) {
9832 :
9833 : /* "View.MemoryView":532
9834 : *
9835 : * if flags & PyBUF_STRIDES:
9836 : * info.strides = self.view.strides # <<<<<<<<<<<<<<
9837 : * else:
9838 : * info.strides = NULL
9839 : */
9840 203 : __pyx_t_3 = __pyx_v_self->view.strides;
9841 203 : __pyx_v_info->strides = __pyx_t_3;
9842 :
9843 : /* "View.MemoryView":531
9844 : * info.shape = NULL
9845 : *
9846 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
9847 : * info.strides = self.view.strides
9848 : * else:
9849 : */
9850 203 : goto __pyx_L7;
9851 : }
9852 :
9853 : /* "View.MemoryView":534
9854 : * info.strides = self.view.strides
9855 : * else:
9856 : * info.strides = NULL # <<<<<<<<<<<<<<
9857 : *
9858 : * if flags & PyBUF_INDIRECT:
9859 : */
9860 : /*else*/ {
9861 0 : __pyx_v_info->strides = NULL;
9862 : }
9863 203 : __pyx_L7:;
9864 :
9865 : /* "View.MemoryView":536
9866 : * info.strides = NULL
9867 : *
9868 : * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
9869 : * info.suboffsets = self.view.suboffsets
9870 : * else:
9871 : */
9872 203 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
9873 203 : if (__pyx_t_1) {
9874 :
9875 : /* "View.MemoryView":537
9876 : *
9877 : * if flags & PyBUF_INDIRECT:
9878 : * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
9879 : * else:
9880 : * info.suboffsets = NULL
9881 : */
9882 203 : __pyx_t_3 = __pyx_v_self->view.suboffsets;
9883 203 : __pyx_v_info->suboffsets = __pyx_t_3;
9884 :
9885 : /* "View.MemoryView":536
9886 : * info.strides = NULL
9887 : *
9888 : * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
9889 : * info.suboffsets = self.view.suboffsets
9890 : * else:
9891 : */
9892 203 : goto __pyx_L8;
9893 : }
9894 :
9895 : /* "View.MemoryView":539
9896 : * info.suboffsets = self.view.suboffsets
9897 : * else:
9898 : * info.suboffsets = NULL # <<<<<<<<<<<<<<
9899 : *
9900 : * if flags & PyBUF_FORMAT:
9901 : */
9902 : /*else*/ {
9903 0 : __pyx_v_info->suboffsets = NULL;
9904 : }
9905 203 : __pyx_L8:;
9906 :
9907 : /* "View.MemoryView":541
9908 : * info.suboffsets = NULL
9909 : *
9910 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9911 : * info.format = self.view.format
9912 : * else:
9913 : */
9914 203 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9915 203 : if (__pyx_t_1) {
9916 :
9917 : /* "View.MemoryView":542
9918 : *
9919 : * if flags & PyBUF_FORMAT:
9920 : * info.format = self.view.format # <<<<<<<<<<<<<<
9921 : * else:
9922 : * info.format = NULL
9923 : */
9924 203 : __pyx_t_4 = __pyx_v_self->view.format;
9925 203 : __pyx_v_info->format = __pyx_t_4;
9926 :
9927 : /* "View.MemoryView":541
9928 : * info.suboffsets = NULL
9929 : *
9930 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9931 : * info.format = self.view.format
9932 : * else:
9933 : */
9934 203 : goto __pyx_L9;
9935 : }
9936 :
9937 : /* "View.MemoryView":544
9938 : * info.format = self.view.format
9939 : * else:
9940 : * info.format = NULL # <<<<<<<<<<<<<<
9941 : *
9942 : * info.buf = self.view.buf
9943 : */
9944 : /*else*/ {
9945 0 : __pyx_v_info->format = NULL;
9946 : }
9947 203 : __pyx_L9:;
9948 :
9949 : /* "View.MemoryView":546
9950 : * info.format = NULL
9951 : *
9952 : * info.buf = self.view.buf # <<<<<<<<<<<<<<
9953 : * info.ndim = self.view.ndim
9954 : * info.itemsize = self.view.itemsize
9955 : */
9956 203 : __pyx_t_5 = __pyx_v_self->view.buf;
9957 203 : __pyx_v_info->buf = __pyx_t_5;
9958 :
9959 : /* "View.MemoryView":547
9960 : *
9961 : * info.buf = self.view.buf
9962 : * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
9963 : * info.itemsize = self.view.itemsize
9964 : * info.len = self.view.len
9965 : */
9966 203 : __pyx_t_6 = __pyx_v_self->view.ndim;
9967 203 : __pyx_v_info->ndim = __pyx_t_6;
9968 :
9969 : /* "View.MemoryView":548
9970 : * info.buf = self.view.buf
9971 : * info.ndim = self.view.ndim
9972 : * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
9973 : * info.len = self.view.len
9974 : * info.readonly = self.view.readonly
9975 : */
9976 203 : __pyx_t_7 = __pyx_v_self->view.itemsize;
9977 203 : __pyx_v_info->itemsize = __pyx_t_7;
9978 :
9979 : /* "View.MemoryView":549
9980 : * info.ndim = self.view.ndim
9981 : * info.itemsize = self.view.itemsize
9982 : * info.len = self.view.len # <<<<<<<<<<<<<<
9983 : * info.readonly = self.view.readonly
9984 : * info.obj = self
9985 : */
9986 203 : __pyx_t_7 = __pyx_v_self->view.len;
9987 203 : __pyx_v_info->len = __pyx_t_7;
9988 :
9989 : /* "View.MemoryView":550
9990 : * info.itemsize = self.view.itemsize
9991 : * info.len = self.view.len
9992 : * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
9993 : * info.obj = self
9994 : *
9995 : */
9996 203 : __pyx_t_1 = __pyx_v_self->view.readonly;
9997 203 : __pyx_v_info->readonly = __pyx_t_1;
9998 :
9999 : /* "View.MemoryView":551
10000 : * info.len = self.view.len
10001 : * info.readonly = self.view.readonly
10002 : * info.obj = self # <<<<<<<<<<<<<<
10003 : *
10004 : *
10005 : */
10006 203 : __Pyx_INCREF((PyObject *)__pyx_v_self);
10007 203 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
10008 203 : __Pyx_GOTREF(__pyx_v_info->obj);
10009 203 : __Pyx_DECREF(__pyx_v_info->obj);
10010 203 : __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10011 :
10012 : /* "View.MemoryView":521
10013 : * itemp[i] = c
10014 : *
10015 : * @cname('getbuffer') # <<<<<<<<<<<<<<
10016 : * def __getbuffer__(self, Py_buffer *info, int flags):
10017 : * if flags & PyBUF_WRITABLE and self.view.readonly:
10018 : */
10019 :
10020 : /* function exit code */
10021 203 : __pyx_r = 0;
10022 203 : goto __pyx_L0;
10023 0 : __pyx_L1_error:;
10024 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10025 0 : __pyx_r = -1;
10026 0 : if (__pyx_v_info->obj != NULL) {
10027 0 : __Pyx_GOTREF(__pyx_v_info->obj);
10028 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10029 : }
10030 0 : goto __pyx_L2;
10031 203 : __pyx_L0:;
10032 203 : if (__pyx_v_info->obj == Py_None) {
10033 0 : __Pyx_GOTREF(__pyx_v_info->obj);
10034 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10035 : }
10036 203 : __pyx_L2:;
10037 : __Pyx_RefNannyFinishContext();
10038 : return __pyx_r;
10039 : }
10040 :
10041 : /* "View.MemoryView":554
10042 : *
10043 : *
10044 : * @property # <<<<<<<<<<<<<<
10045 : * def T(self):
10046 : * cdef _memoryviewslice result = memoryview_copy(self)
10047 : */
10048 :
10049 : /* Python wrapper */
10050 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
10051 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10052 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10053 0 : PyObject *__pyx_r = 0;
10054 : __Pyx_RefNannyDeclarations
10055 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10056 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10057 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10058 :
10059 : /* function exit code */
10060 0 : __Pyx_RefNannyFinishContext();
10061 0 : return __pyx_r;
10062 : }
10063 :
10064 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10065 0 : struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10066 0 : PyObject *__pyx_r = NULL;
10067 : __Pyx_RefNannyDeclarations
10068 0 : PyObject *__pyx_t_1 = NULL;
10069 0 : int __pyx_t_2;
10070 0 : int __pyx_lineno = 0;
10071 0 : const char *__pyx_filename = NULL;
10072 0 : int __pyx_clineno = 0;
10073 0 : __Pyx_RefNannySetupContext("__get__", 1);
10074 :
10075 : /* "View.MemoryView":556
10076 : * @property
10077 : * def T(self):
10078 : * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
10079 : * transpose_memslice(&result.from_slice)
10080 : * return result
10081 : */
10082 0 : __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
10083 0 : __Pyx_GOTREF(__pyx_t_1);
10084 0 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
10085 0 : __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10086 0 : __pyx_t_1 = 0;
10087 :
10088 : /* "View.MemoryView":557
10089 : * def T(self):
10090 : * cdef _memoryviewslice result = memoryview_copy(self)
10091 : * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
10092 : * return result
10093 : *
10094 : */
10095 0 : __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 557, __pyx_L1_error)
10096 :
10097 : /* "View.MemoryView":558
10098 : * cdef _memoryviewslice result = memoryview_copy(self)
10099 : * transpose_memslice(&result.from_slice)
10100 : * return result # <<<<<<<<<<<<<<
10101 : *
10102 : * @property
10103 : */
10104 0 : __Pyx_XDECREF(__pyx_r);
10105 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
10106 0 : __pyx_r = ((PyObject *)__pyx_v_result);
10107 0 : goto __pyx_L0;
10108 :
10109 : /* "View.MemoryView":554
10110 : *
10111 : *
10112 : * @property # <<<<<<<<<<<<<<
10113 : * def T(self):
10114 : * cdef _memoryviewslice result = memoryview_copy(self)
10115 : */
10116 :
10117 : /* function exit code */
10118 0 : __pyx_L1_error:;
10119 0 : __Pyx_XDECREF(__pyx_t_1);
10120 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10121 0 : __pyx_r = NULL;
10122 0 : __pyx_L0:;
10123 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
10124 0 : __Pyx_XGIVEREF(__pyx_r);
10125 0 : __Pyx_RefNannyFinishContext();
10126 0 : return __pyx_r;
10127 : }
10128 :
10129 : /* "View.MemoryView":560
10130 : * return result
10131 : *
10132 : * @property # <<<<<<<<<<<<<<
10133 : * def base(self):
10134 : * return self._get_base()
10135 : */
10136 :
10137 : /* Python wrapper */
10138 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
10139 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10140 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10141 0 : PyObject *__pyx_r = 0;
10142 : __Pyx_RefNannyDeclarations
10143 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10144 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10145 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10146 :
10147 : /* function exit code */
10148 0 : __Pyx_RefNannyFinishContext();
10149 0 : return __pyx_r;
10150 : }
10151 :
10152 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10153 0 : PyObject *__pyx_r = NULL;
10154 : __Pyx_RefNannyDeclarations
10155 0 : PyObject *__pyx_t_1 = NULL;
10156 0 : int __pyx_lineno = 0;
10157 0 : const char *__pyx_filename = NULL;
10158 0 : int __pyx_clineno = 0;
10159 0 : __Pyx_RefNannySetupContext("__get__", 1);
10160 :
10161 : /* "View.MemoryView":562
10162 : * @property
10163 : * def base(self):
10164 : * return self._get_base() # <<<<<<<<<<<<<<
10165 : *
10166 : * cdef _get_base(self):
10167 : */
10168 0 : __Pyx_XDECREF(__pyx_r);
10169 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 562, __pyx_L1_error)
10170 0 : __Pyx_GOTREF(__pyx_t_1);
10171 0 : __pyx_r = __pyx_t_1;
10172 0 : __pyx_t_1 = 0;
10173 0 : goto __pyx_L0;
10174 :
10175 : /* "View.MemoryView":560
10176 : * return result
10177 : *
10178 : * @property # <<<<<<<<<<<<<<
10179 : * def base(self):
10180 : * return self._get_base()
10181 : */
10182 :
10183 : /* function exit code */
10184 0 : __pyx_L1_error:;
10185 0 : __Pyx_XDECREF(__pyx_t_1);
10186 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10187 0 : __pyx_r = NULL;
10188 0 : __pyx_L0:;
10189 0 : __Pyx_XGIVEREF(__pyx_r);
10190 0 : __Pyx_RefNannyFinishContext();
10191 0 : return __pyx_r;
10192 : }
10193 :
10194 : /* "View.MemoryView":564
10195 : * return self._get_base()
10196 : *
10197 : * cdef _get_base(self): # <<<<<<<<<<<<<<
10198 : * return self.obj
10199 : *
10200 : */
10201 :
10202 338 : static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
10203 338 : PyObject *__pyx_r = NULL;
10204 : __Pyx_RefNannyDeclarations
10205 338 : __Pyx_RefNannySetupContext("_get_base", 1);
10206 :
10207 : /* "View.MemoryView":565
10208 : *
10209 : * cdef _get_base(self):
10210 : * return self.obj # <<<<<<<<<<<<<<
10211 : *
10212 : * @property
10213 : */
10214 338 : __Pyx_XDECREF(__pyx_r);
10215 338 : __Pyx_INCREF(__pyx_v_self->obj);
10216 338 : __pyx_r = __pyx_v_self->obj;
10217 338 : goto __pyx_L0;
10218 :
10219 : /* "View.MemoryView":564
10220 : * return self._get_base()
10221 : *
10222 : * cdef _get_base(self): # <<<<<<<<<<<<<<
10223 : * return self.obj
10224 : *
10225 : */
10226 :
10227 : /* function exit code */
10228 338 : __pyx_L0:;
10229 338 : __Pyx_XGIVEREF(__pyx_r);
10230 338 : __Pyx_RefNannyFinishContext();
10231 338 : return __pyx_r;
10232 : }
10233 :
10234 : /* "View.MemoryView":567
10235 : * return self.obj
10236 : *
10237 : * @property # <<<<<<<<<<<<<<
10238 : * def shape(self):
10239 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10240 : */
10241 :
10242 : /* Python wrapper */
10243 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
10244 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
10245 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10246 0 : PyObject *__pyx_r = 0;
10247 : __Pyx_RefNannyDeclarations
10248 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10249 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10250 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10251 :
10252 : /* function exit code */
10253 0 : __Pyx_RefNannyFinishContext();
10254 0 : return __pyx_r;
10255 : }
10256 :
10257 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10258 0 : Py_ssize_t __pyx_7genexpr__pyx_v_length;
10259 0 : PyObject *__pyx_r = NULL;
10260 : __Pyx_RefNannyDeclarations
10261 0 : PyObject *__pyx_t_1 = NULL;
10262 0 : Py_ssize_t *__pyx_t_2;
10263 0 : Py_ssize_t *__pyx_t_3;
10264 0 : Py_ssize_t *__pyx_t_4;
10265 0 : PyObject *__pyx_t_5 = NULL;
10266 0 : int __pyx_lineno = 0;
10267 0 : const char *__pyx_filename = NULL;
10268 0 : int __pyx_clineno = 0;
10269 0 : __Pyx_RefNannySetupContext("__get__", 1);
10270 :
10271 : /* "View.MemoryView":569
10272 : * @property
10273 : * def shape(self):
10274 : * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
10275 : *
10276 : * @property
10277 : */
10278 0 : __Pyx_XDECREF(__pyx_r);
10279 : { /* enter inner scope */
10280 0 : __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error)
10281 0 : __Pyx_GOTREF(__pyx_t_1);
10282 0 : __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10283 0 : for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10284 0 : __pyx_t_2 = __pyx_t_4;
10285 0 : __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
10286 0 : __pyx_t_5 = PyInt_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
10287 0 : __Pyx_GOTREF(__pyx_t_5);
10288 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 569, __pyx_L1_error)
10289 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10290 : }
10291 : } /* exit inner scope */
10292 0 : __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
10293 0 : __Pyx_GOTREF(__pyx_t_5);
10294 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10295 0 : __pyx_r = __pyx_t_5;
10296 0 : __pyx_t_5 = 0;
10297 0 : goto __pyx_L0;
10298 :
10299 : /* "View.MemoryView":567
10300 : * return self.obj
10301 : *
10302 : * @property # <<<<<<<<<<<<<<
10303 : * def shape(self):
10304 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10305 : */
10306 :
10307 : /* function exit code */
10308 0 : __pyx_L1_error:;
10309 0 : __Pyx_XDECREF(__pyx_t_1);
10310 0 : __Pyx_XDECREF(__pyx_t_5);
10311 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10312 0 : __pyx_r = NULL;
10313 0 : __pyx_L0:;
10314 0 : __Pyx_XGIVEREF(__pyx_r);
10315 0 : __Pyx_RefNannyFinishContext();
10316 0 : return __pyx_r;
10317 : }
10318 :
10319 : /* "View.MemoryView":571
10320 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10321 : *
10322 : * @property # <<<<<<<<<<<<<<
10323 : * def strides(self):
10324 : * if self.view.strides == NULL:
10325 : */
10326 :
10327 : /* Python wrapper */
10328 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
10329 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
10330 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10331 0 : PyObject *__pyx_r = 0;
10332 : __Pyx_RefNannyDeclarations
10333 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10334 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10335 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10336 :
10337 : /* function exit code */
10338 0 : __Pyx_RefNannyFinishContext();
10339 0 : return __pyx_r;
10340 : }
10341 :
10342 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10343 0 : Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
10344 0 : PyObject *__pyx_r = NULL;
10345 : __Pyx_RefNannyDeclarations
10346 0 : int __pyx_t_1;
10347 0 : PyObject *__pyx_t_2 = NULL;
10348 0 : Py_ssize_t *__pyx_t_3;
10349 0 : Py_ssize_t *__pyx_t_4;
10350 0 : Py_ssize_t *__pyx_t_5;
10351 0 : PyObject *__pyx_t_6 = NULL;
10352 0 : int __pyx_lineno = 0;
10353 0 : const char *__pyx_filename = NULL;
10354 0 : int __pyx_clineno = 0;
10355 0 : __Pyx_RefNannySetupContext("__get__", 1);
10356 :
10357 : /* "View.MemoryView":573
10358 : * @property
10359 : * def strides(self):
10360 : * if self.view.strides == NULL: # <<<<<<<<<<<<<<
10361 : *
10362 : * raise ValueError, "Buffer view does not expose strides"
10363 : */
10364 0 : __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
10365 0 : if (unlikely(__pyx_t_1)) {
10366 :
10367 : /* "View.MemoryView":575
10368 : * if self.view.strides == NULL:
10369 : *
10370 : * raise ValueError, "Buffer view does not expose strides" # <<<<<<<<<<<<<<
10371 : *
10372 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10373 : */
10374 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Buffer_view_does_not_expose_stri, 0, 0);
10375 0 : __PYX_ERR(1, 575, __pyx_L1_error)
10376 :
10377 : /* "View.MemoryView":573
10378 : * @property
10379 : * def strides(self):
10380 : * if self.view.strides == NULL: # <<<<<<<<<<<<<<
10381 : *
10382 : * raise ValueError, "Buffer view does not expose strides"
10383 : */
10384 : }
10385 :
10386 : /* "View.MemoryView":577
10387 : * raise ValueError, "Buffer view does not expose strides"
10388 : *
10389 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
10390 : *
10391 : * @property
10392 : */
10393 0 : __Pyx_XDECREF(__pyx_r);
10394 : { /* enter inner scope */
10395 0 : __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
10396 0 : __Pyx_GOTREF(__pyx_t_2);
10397 0 : __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
10398 0 : for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10399 0 : __pyx_t_3 = __pyx_t_5;
10400 0 : __pyx_8genexpr1__pyx_v_stride = (__pyx_t_3[0]);
10401 0 : __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
10402 0 : __Pyx_GOTREF(__pyx_t_6);
10403 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 577, __pyx_L1_error)
10404 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10405 : }
10406 : } /* exit inner scope */
10407 0 : __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
10408 0 : __Pyx_GOTREF(__pyx_t_6);
10409 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10410 0 : __pyx_r = __pyx_t_6;
10411 0 : __pyx_t_6 = 0;
10412 0 : goto __pyx_L0;
10413 :
10414 : /* "View.MemoryView":571
10415 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10416 : *
10417 : * @property # <<<<<<<<<<<<<<
10418 : * def strides(self):
10419 : * if self.view.strides == NULL:
10420 : */
10421 :
10422 : /* function exit code */
10423 0 : __pyx_L1_error:;
10424 0 : __Pyx_XDECREF(__pyx_t_2);
10425 0 : __Pyx_XDECREF(__pyx_t_6);
10426 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10427 0 : __pyx_r = NULL;
10428 0 : __pyx_L0:;
10429 0 : __Pyx_XGIVEREF(__pyx_r);
10430 0 : __Pyx_RefNannyFinishContext();
10431 0 : return __pyx_r;
10432 : }
10433 :
10434 : /* "View.MemoryView":579
10435 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10436 : *
10437 : * @property # <<<<<<<<<<<<<<
10438 : * def suboffsets(self):
10439 : * if self.view.suboffsets == NULL:
10440 : */
10441 :
10442 : /* Python wrapper */
10443 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
10444 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
10445 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10446 0 : PyObject *__pyx_r = 0;
10447 : __Pyx_RefNannyDeclarations
10448 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10449 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10450 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10451 :
10452 : /* function exit code */
10453 0 : __Pyx_RefNannyFinishContext();
10454 0 : return __pyx_r;
10455 : }
10456 :
10457 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10458 0 : Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
10459 0 : PyObject *__pyx_r = NULL;
10460 : __Pyx_RefNannyDeclarations
10461 0 : int __pyx_t_1;
10462 0 : PyObject *__pyx_t_2 = NULL;
10463 0 : Py_ssize_t *__pyx_t_3;
10464 0 : Py_ssize_t *__pyx_t_4;
10465 0 : Py_ssize_t *__pyx_t_5;
10466 0 : PyObject *__pyx_t_6 = NULL;
10467 0 : int __pyx_lineno = 0;
10468 0 : const char *__pyx_filename = NULL;
10469 0 : int __pyx_clineno = 0;
10470 0 : __Pyx_RefNannySetupContext("__get__", 1);
10471 :
10472 : /* "View.MemoryView":581
10473 : * @property
10474 : * def suboffsets(self):
10475 : * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10476 : * return (-1,) * self.view.ndim
10477 : *
10478 : */
10479 0 : __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
10480 0 : if (__pyx_t_1) {
10481 :
10482 : /* "View.MemoryView":582
10483 : * def suboffsets(self):
10484 : * if self.view.suboffsets == NULL:
10485 : * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
10486 : *
10487 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10488 : */
10489 0 : __Pyx_XDECREF(__pyx_r);
10490 0 : __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_tuple__4, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 582, __pyx_L1_error)
10491 0 : __Pyx_GOTREF(__pyx_t_2);
10492 0 : __pyx_r = __pyx_t_2;
10493 0 : __pyx_t_2 = 0;
10494 0 : goto __pyx_L0;
10495 :
10496 : /* "View.MemoryView":581
10497 : * @property
10498 : * def suboffsets(self):
10499 : * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10500 : * return (-1,) * self.view.ndim
10501 : *
10502 : */
10503 : }
10504 :
10505 : /* "View.MemoryView":584
10506 : * return (-1,) * self.view.ndim
10507 : *
10508 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
10509 : *
10510 : * @property
10511 : */
10512 0 : __Pyx_XDECREF(__pyx_r);
10513 : { /* enter inner scope */
10514 0 : __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 584, __pyx_L1_error)
10515 0 : __Pyx_GOTREF(__pyx_t_2);
10516 0 : __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
10517 0 : for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10518 0 : __pyx_t_3 = __pyx_t_5;
10519 0 : __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
10520 0 : __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
10521 0 : __Pyx_GOTREF(__pyx_t_6);
10522 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 584, __pyx_L1_error)
10523 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10524 : }
10525 : } /* exit inner scope */
10526 0 : __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
10527 0 : __Pyx_GOTREF(__pyx_t_6);
10528 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10529 0 : __pyx_r = __pyx_t_6;
10530 0 : __pyx_t_6 = 0;
10531 0 : goto __pyx_L0;
10532 :
10533 : /* "View.MemoryView":579
10534 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10535 : *
10536 : * @property # <<<<<<<<<<<<<<
10537 : * def suboffsets(self):
10538 : * if self.view.suboffsets == NULL:
10539 : */
10540 :
10541 : /* function exit code */
10542 0 : __pyx_L1_error:;
10543 0 : __Pyx_XDECREF(__pyx_t_2);
10544 0 : __Pyx_XDECREF(__pyx_t_6);
10545 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10546 0 : __pyx_r = NULL;
10547 0 : __pyx_L0:;
10548 0 : __Pyx_XGIVEREF(__pyx_r);
10549 0 : __Pyx_RefNannyFinishContext();
10550 0 : return __pyx_r;
10551 : }
10552 :
10553 : /* "View.MemoryView":586
10554 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10555 : *
10556 : * @property # <<<<<<<<<<<<<<
10557 : * def ndim(self):
10558 : * return self.view.ndim
10559 : */
10560 :
10561 : /* Python wrapper */
10562 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
10563 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
10564 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10565 0 : PyObject *__pyx_r = 0;
10566 : __Pyx_RefNannyDeclarations
10567 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10568 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10569 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10570 :
10571 : /* function exit code */
10572 0 : __Pyx_RefNannyFinishContext();
10573 0 : return __pyx_r;
10574 : }
10575 :
10576 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10577 0 : PyObject *__pyx_r = NULL;
10578 : __Pyx_RefNannyDeclarations
10579 0 : PyObject *__pyx_t_1 = NULL;
10580 0 : int __pyx_lineno = 0;
10581 0 : const char *__pyx_filename = NULL;
10582 0 : int __pyx_clineno = 0;
10583 0 : __Pyx_RefNannySetupContext("__get__", 1);
10584 :
10585 : /* "View.MemoryView":588
10586 : * @property
10587 : * def ndim(self):
10588 : * return self.view.ndim # <<<<<<<<<<<<<<
10589 : *
10590 : * @property
10591 : */
10592 0 : __Pyx_XDECREF(__pyx_r);
10593 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 588, __pyx_L1_error)
10594 0 : __Pyx_GOTREF(__pyx_t_1);
10595 0 : __pyx_r = __pyx_t_1;
10596 0 : __pyx_t_1 = 0;
10597 0 : goto __pyx_L0;
10598 :
10599 : /* "View.MemoryView":586
10600 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10601 : *
10602 : * @property # <<<<<<<<<<<<<<
10603 : * def ndim(self):
10604 : * return self.view.ndim
10605 : */
10606 :
10607 : /* function exit code */
10608 0 : __pyx_L1_error:;
10609 0 : __Pyx_XDECREF(__pyx_t_1);
10610 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10611 0 : __pyx_r = NULL;
10612 0 : __pyx_L0:;
10613 0 : __Pyx_XGIVEREF(__pyx_r);
10614 0 : __Pyx_RefNannyFinishContext();
10615 0 : return __pyx_r;
10616 : }
10617 :
10618 : /* "View.MemoryView":590
10619 : * return self.view.ndim
10620 : *
10621 : * @property # <<<<<<<<<<<<<<
10622 : * def itemsize(self):
10623 : * return self.view.itemsize
10624 : */
10625 :
10626 : /* Python wrapper */
10627 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
10628 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
10629 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10630 0 : PyObject *__pyx_r = 0;
10631 : __Pyx_RefNannyDeclarations
10632 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10633 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10634 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10635 :
10636 : /* function exit code */
10637 0 : __Pyx_RefNannyFinishContext();
10638 0 : return __pyx_r;
10639 : }
10640 :
10641 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10642 0 : PyObject *__pyx_r = NULL;
10643 : __Pyx_RefNannyDeclarations
10644 0 : PyObject *__pyx_t_1 = NULL;
10645 0 : int __pyx_lineno = 0;
10646 0 : const char *__pyx_filename = NULL;
10647 0 : int __pyx_clineno = 0;
10648 0 : __Pyx_RefNannySetupContext("__get__", 1);
10649 :
10650 : /* "View.MemoryView":592
10651 : * @property
10652 : * def itemsize(self):
10653 : * return self.view.itemsize # <<<<<<<<<<<<<<
10654 : *
10655 : * @property
10656 : */
10657 0 : __Pyx_XDECREF(__pyx_r);
10658 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error)
10659 0 : __Pyx_GOTREF(__pyx_t_1);
10660 0 : __pyx_r = __pyx_t_1;
10661 0 : __pyx_t_1 = 0;
10662 0 : goto __pyx_L0;
10663 :
10664 : /* "View.MemoryView":590
10665 : * return self.view.ndim
10666 : *
10667 : * @property # <<<<<<<<<<<<<<
10668 : * def itemsize(self):
10669 : * return self.view.itemsize
10670 : */
10671 :
10672 : /* function exit code */
10673 0 : __pyx_L1_error:;
10674 0 : __Pyx_XDECREF(__pyx_t_1);
10675 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10676 0 : __pyx_r = NULL;
10677 0 : __pyx_L0:;
10678 0 : __Pyx_XGIVEREF(__pyx_r);
10679 0 : __Pyx_RefNannyFinishContext();
10680 0 : return __pyx_r;
10681 : }
10682 :
10683 : /* "View.MemoryView":594
10684 : * return self.view.itemsize
10685 : *
10686 : * @property # <<<<<<<<<<<<<<
10687 : * def nbytes(self):
10688 : * return self.size * self.view.itemsize
10689 : */
10690 :
10691 : /* Python wrapper */
10692 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
10693 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
10694 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10695 0 : PyObject *__pyx_r = 0;
10696 : __Pyx_RefNannyDeclarations
10697 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10698 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10699 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10700 :
10701 : /* function exit code */
10702 0 : __Pyx_RefNannyFinishContext();
10703 0 : return __pyx_r;
10704 : }
10705 :
10706 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10707 0 : PyObject *__pyx_r = NULL;
10708 : __Pyx_RefNannyDeclarations
10709 0 : PyObject *__pyx_t_1 = NULL;
10710 0 : PyObject *__pyx_t_2 = NULL;
10711 0 : PyObject *__pyx_t_3 = NULL;
10712 0 : int __pyx_lineno = 0;
10713 0 : const char *__pyx_filename = NULL;
10714 0 : int __pyx_clineno = 0;
10715 0 : __Pyx_RefNannySetupContext("__get__", 1);
10716 :
10717 : /* "View.MemoryView":596
10718 : * @property
10719 : * def nbytes(self):
10720 : * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
10721 : *
10722 : * @property
10723 : */
10724 0 : __Pyx_XDECREF(__pyx_r);
10725 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 596, __pyx_L1_error)
10726 0 : __Pyx_GOTREF(__pyx_t_1);
10727 0 : __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 596, __pyx_L1_error)
10728 0 : __Pyx_GOTREF(__pyx_t_2);
10729 0 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 596, __pyx_L1_error)
10730 0 : __Pyx_GOTREF(__pyx_t_3);
10731 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10732 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10733 0 : __pyx_r = __pyx_t_3;
10734 0 : __pyx_t_3 = 0;
10735 0 : goto __pyx_L0;
10736 :
10737 : /* "View.MemoryView":594
10738 : * return self.view.itemsize
10739 : *
10740 : * @property # <<<<<<<<<<<<<<
10741 : * def nbytes(self):
10742 : * return self.size * self.view.itemsize
10743 : */
10744 :
10745 : /* function exit code */
10746 0 : __pyx_L1_error:;
10747 0 : __Pyx_XDECREF(__pyx_t_1);
10748 0 : __Pyx_XDECREF(__pyx_t_2);
10749 0 : __Pyx_XDECREF(__pyx_t_3);
10750 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10751 0 : __pyx_r = NULL;
10752 0 : __pyx_L0:;
10753 0 : __Pyx_XGIVEREF(__pyx_r);
10754 0 : __Pyx_RefNannyFinishContext();
10755 0 : return __pyx_r;
10756 : }
10757 :
10758 : /* "View.MemoryView":598
10759 : * return self.size * self.view.itemsize
10760 : *
10761 : * @property # <<<<<<<<<<<<<<
10762 : * def size(self):
10763 : * if self._size is None:
10764 : */
10765 :
10766 : /* Python wrapper */
10767 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
10768 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
10769 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10770 0 : PyObject *__pyx_r = 0;
10771 : __Pyx_RefNannyDeclarations
10772 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10773 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10774 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10775 :
10776 : /* function exit code */
10777 0 : __Pyx_RefNannyFinishContext();
10778 0 : return __pyx_r;
10779 : }
10780 :
10781 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10782 0 : PyObject *__pyx_v_result = NULL;
10783 0 : PyObject *__pyx_v_length = NULL;
10784 0 : PyObject *__pyx_r = NULL;
10785 : __Pyx_RefNannyDeclarations
10786 0 : int __pyx_t_1;
10787 0 : Py_ssize_t *__pyx_t_2;
10788 0 : Py_ssize_t *__pyx_t_3;
10789 0 : Py_ssize_t *__pyx_t_4;
10790 0 : PyObject *__pyx_t_5 = NULL;
10791 0 : int __pyx_lineno = 0;
10792 0 : const char *__pyx_filename = NULL;
10793 0 : int __pyx_clineno = 0;
10794 0 : __Pyx_RefNannySetupContext("__get__", 1);
10795 :
10796 : /* "View.MemoryView":600
10797 : * @property
10798 : * def size(self):
10799 : * if self._size is None: # <<<<<<<<<<<<<<
10800 : * result = 1
10801 : *
10802 : */
10803 0 : __pyx_t_1 = (__pyx_v_self->_size == Py_None);
10804 0 : if (__pyx_t_1) {
10805 :
10806 : /* "View.MemoryView":601
10807 : * def size(self):
10808 : * if self._size is None:
10809 : * result = 1 # <<<<<<<<<<<<<<
10810 : *
10811 : * for length in self.view.shape[:self.view.ndim]:
10812 : */
10813 0 : __Pyx_INCREF(__pyx_int_1);
10814 0 : __pyx_v_result = __pyx_int_1;
10815 :
10816 : /* "View.MemoryView":603
10817 : * result = 1
10818 : *
10819 : * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
10820 : * result *= length
10821 : *
10822 : */
10823 0 : __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10824 0 : for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10825 0 : __pyx_t_2 = __pyx_t_4;
10826 0 : __pyx_t_5 = PyInt_FromSsize_t((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 603, __pyx_L1_error)
10827 0 : __Pyx_GOTREF(__pyx_t_5);
10828 0 : __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_5);
10829 0 : __pyx_t_5 = 0;
10830 :
10831 : /* "View.MemoryView":604
10832 : *
10833 : * for length in self.view.shape[:self.view.ndim]:
10834 : * result *= length # <<<<<<<<<<<<<<
10835 : *
10836 : * self._size = result
10837 : */
10838 0 : __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 604, __pyx_L1_error)
10839 0 : __Pyx_GOTREF(__pyx_t_5);
10840 0 : __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
10841 0 : __pyx_t_5 = 0;
10842 : }
10843 :
10844 : /* "View.MemoryView":606
10845 : * result *= length
10846 : *
10847 : * self._size = result # <<<<<<<<<<<<<<
10848 : *
10849 : * return self._size
10850 : */
10851 0 : __Pyx_INCREF(__pyx_v_result);
10852 0 : __Pyx_GIVEREF(__pyx_v_result);
10853 0 : __Pyx_GOTREF(__pyx_v_self->_size);
10854 0 : __Pyx_DECREF(__pyx_v_self->_size);
10855 0 : __pyx_v_self->_size = __pyx_v_result;
10856 :
10857 : /* "View.MemoryView":600
10858 : * @property
10859 : * def size(self):
10860 : * if self._size is None: # <<<<<<<<<<<<<<
10861 : * result = 1
10862 : *
10863 : */
10864 : }
10865 :
10866 : /* "View.MemoryView":608
10867 : * self._size = result
10868 : *
10869 : * return self._size # <<<<<<<<<<<<<<
10870 : *
10871 : * def __len__(self):
10872 : */
10873 0 : __Pyx_XDECREF(__pyx_r);
10874 0 : __Pyx_INCREF(__pyx_v_self->_size);
10875 0 : __pyx_r = __pyx_v_self->_size;
10876 0 : goto __pyx_L0;
10877 :
10878 : /* "View.MemoryView":598
10879 : * return self.size * self.view.itemsize
10880 : *
10881 : * @property # <<<<<<<<<<<<<<
10882 : * def size(self):
10883 : * if self._size is None:
10884 : */
10885 :
10886 : /* function exit code */
10887 0 : __pyx_L1_error:;
10888 0 : __Pyx_XDECREF(__pyx_t_5);
10889 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10890 0 : __pyx_r = NULL;
10891 0 : __pyx_L0:;
10892 0 : __Pyx_XDECREF(__pyx_v_result);
10893 0 : __Pyx_XDECREF(__pyx_v_length);
10894 0 : __Pyx_XGIVEREF(__pyx_r);
10895 0 : __Pyx_RefNannyFinishContext();
10896 0 : return __pyx_r;
10897 : }
10898 :
10899 : /* "View.MemoryView":610
10900 : * return self._size
10901 : *
10902 : * def __len__(self): # <<<<<<<<<<<<<<
10903 : * if self.view.ndim >= 1:
10904 : * return self.view.shape[0]
10905 : */
10906 :
10907 : /* Python wrapper */
10908 : static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
10909 0 : static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
10910 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10911 0 : Py_ssize_t __pyx_r;
10912 : __Pyx_RefNannyDeclarations
10913 0 : __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
10914 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10915 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10916 :
10917 : /* function exit code */
10918 0 : __Pyx_RefNannyFinishContext();
10919 0 : return __pyx_r;
10920 : }
10921 :
10922 0 : static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
10923 0 : Py_ssize_t __pyx_r;
10924 0 : int __pyx_t_1;
10925 :
10926 : /* "View.MemoryView":611
10927 : *
10928 : * def __len__(self):
10929 : * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
10930 : * return self.view.shape[0]
10931 : *
10932 : */
10933 0 : __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
10934 0 : if (__pyx_t_1) {
10935 :
10936 : /* "View.MemoryView":612
10937 : * def __len__(self):
10938 : * if self.view.ndim >= 1:
10939 : * return self.view.shape[0] # <<<<<<<<<<<<<<
10940 : *
10941 : * return 0
10942 : */
10943 0 : __pyx_r = (__pyx_v_self->view.shape[0]);
10944 0 : goto __pyx_L0;
10945 :
10946 : /* "View.MemoryView":611
10947 : *
10948 : * def __len__(self):
10949 : * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
10950 : * return self.view.shape[0]
10951 : *
10952 : */
10953 : }
10954 :
10955 : /* "View.MemoryView":614
10956 : * return self.view.shape[0]
10957 : *
10958 : * return 0 # <<<<<<<<<<<<<<
10959 : *
10960 : * def __repr__(self):
10961 : */
10962 0 : __pyx_r = 0;
10963 0 : goto __pyx_L0;
10964 :
10965 : /* "View.MemoryView":610
10966 : * return self._size
10967 : *
10968 : * def __len__(self): # <<<<<<<<<<<<<<
10969 : * if self.view.ndim >= 1:
10970 : * return self.view.shape[0]
10971 : */
10972 :
10973 : /* function exit code */
10974 0 : __pyx_L0:;
10975 0 : return __pyx_r;
10976 : }
10977 :
10978 : /* "View.MemoryView":616
10979 : * return 0
10980 : *
10981 : * def __repr__(self): # <<<<<<<<<<<<<<
10982 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
10983 : * id(self))
10984 : */
10985 :
10986 : /* Python wrapper */
10987 : static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
10988 0 : static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
10989 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10990 0 : PyObject *__pyx_r = 0;
10991 : __Pyx_RefNannyDeclarations
10992 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10993 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10994 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10995 :
10996 : /* function exit code */
10997 0 : __Pyx_RefNannyFinishContext();
10998 0 : return __pyx_r;
10999 : }
11000 :
11001 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
11002 0 : PyObject *__pyx_r = NULL;
11003 : __Pyx_RefNannyDeclarations
11004 0 : PyObject *__pyx_t_1 = NULL;
11005 0 : PyObject *__pyx_t_2 = NULL;
11006 0 : PyObject *__pyx_t_3 = NULL;
11007 0 : int __pyx_lineno = 0;
11008 0 : const char *__pyx_filename = NULL;
11009 0 : int __pyx_clineno = 0;
11010 0 : __Pyx_RefNannySetupContext("__repr__", 1);
11011 :
11012 : /* "View.MemoryView":617
11013 : *
11014 : * def __repr__(self):
11015 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11016 : * id(self))
11017 : *
11018 : */
11019 0 : __Pyx_XDECREF(__pyx_r);
11020 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
11021 0 : __Pyx_GOTREF(__pyx_t_1);
11022 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
11023 0 : __Pyx_GOTREF(__pyx_t_2);
11024 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11025 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
11026 0 : __Pyx_GOTREF(__pyx_t_1);
11027 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11028 :
11029 : /* "View.MemoryView":618
11030 : * def __repr__(self):
11031 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11032 : * id(self)) # <<<<<<<<<<<<<<
11033 : *
11034 : * def __str__(self):
11035 : */
11036 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
11037 0 : __Pyx_GOTREF(__pyx_t_2);
11038 :
11039 : /* "View.MemoryView":617
11040 : *
11041 : * def __repr__(self):
11042 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11043 : * id(self))
11044 : *
11045 : */
11046 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 617, __pyx_L1_error)
11047 0 : __Pyx_GOTREF(__pyx_t_3);
11048 0 : __Pyx_GIVEREF(__pyx_t_1);
11049 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error);
11050 0 : __Pyx_GIVEREF(__pyx_t_2);
11051 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error);
11052 0 : __pyx_t_1 = 0;
11053 0 : __pyx_t_2 = 0;
11054 0 : __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
11055 0 : __Pyx_GOTREF(__pyx_t_2);
11056 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11057 0 : __pyx_r = __pyx_t_2;
11058 0 : __pyx_t_2 = 0;
11059 0 : goto __pyx_L0;
11060 :
11061 : /* "View.MemoryView":616
11062 : * return 0
11063 : *
11064 : * def __repr__(self): # <<<<<<<<<<<<<<
11065 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11066 : * id(self))
11067 : */
11068 :
11069 : /* function exit code */
11070 0 : __pyx_L1_error:;
11071 0 : __Pyx_XDECREF(__pyx_t_1);
11072 0 : __Pyx_XDECREF(__pyx_t_2);
11073 0 : __Pyx_XDECREF(__pyx_t_3);
11074 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11075 0 : __pyx_r = NULL;
11076 0 : __pyx_L0:;
11077 0 : __Pyx_XGIVEREF(__pyx_r);
11078 0 : __Pyx_RefNannyFinishContext();
11079 0 : return __pyx_r;
11080 : }
11081 :
11082 : /* "View.MemoryView":620
11083 : * id(self))
11084 : *
11085 : * def __str__(self): # <<<<<<<<<<<<<<
11086 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11087 : *
11088 : */
11089 :
11090 : /* Python wrapper */
11091 : static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
11092 0 : static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11093 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11094 0 : PyObject *__pyx_r = 0;
11095 : __Pyx_RefNannyDeclarations
11096 0 : __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
11097 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11098 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11099 :
11100 : /* function exit code */
11101 0 : __Pyx_RefNannyFinishContext();
11102 0 : return __pyx_r;
11103 : }
11104 :
11105 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
11106 0 : PyObject *__pyx_r = NULL;
11107 : __Pyx_RefNannyDeclarations
11108 0 : PyObject *__pyx_t_1 = NULL;
11109 0 : PyObject *__pyx_t_2 = NULL;
11110 0 : int __pyx_lineno = 0;
11111 0 : const char *__pyx_filename = NULL;
11112 0 : int __pyx_clineno = 0;
11113 0 : __Pyx_RefNannySetupContext("__str__", 1);
11114 :
11115 : /* "View.MemoryView":621
11116 : *
11117 : * def __str__(self):
11118 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
11119 : *
11120 : *
11121 : */
11122 0 : __Pyx_XDECREF(__pyx_r);
11123 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11124 0 : __Pyx_GOTREF(__pyx_t_1);
11125 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
11126 0 : __Pyx_GOTREF(__pyx_t_2);
11127 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11128 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11129 0 : __Pyx_GOTREF(__pyx_t_1);
11130 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11131 0 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
11132 0 : __Pyx_GOTREF(__pyx_t_2);
11133 0 : __Pyx_GIVEREF(__pyx_t_1);
11134 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error);
11135 0 : __pyx_t_1 = 0;
11136 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11137 0 : __Pyx_GOTREF(__pyx_t_1);
11138 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11139 0 : __pyx_r = __pyx_t_1;
11140 0 : __pyx_t_1 = 0;
11141 0 : goto __pyx_L0;
11142 :
11143 : /* "View.MemoryView":620
11144 : * id(self))
11145 : *
11146 : * def __str__(self): # <<<<<<<<<<<<<<
11147 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11148 : *
11149 : */
11150 :
11151 : /* function exit code */
11152 0 : __pyx_L1_error:;
11153 0 : __Pyx_XDECREF(__pyx_t_1);
11154 0 : __Pyx_XDECREF(__pyx_t_2);
11155 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11156 0 : __pyx_r = NULL;
11157 0 : __pyx_L0:;
11158 0 : __Pyx_XGIVEREF(__pyx_r);
11159 0 : __Pyx_RefNannyFinishContext();
11160 0 : return __pyx_r;
11161 : }
11162 :
11163 : /* "View.MemoryView":624
11164 : *
11165 : *
11166 : * def is_c_contig(self): # <<<<<<<<<<<<<<
11167 : * cdef __Pyx_memviewslice *mslice
11168 : * cdef __Pyx_memviewslice tmp
11169 : */
11170 :
11171 : /* Python wrapper */
11172 : static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11173 : #if CYTHON_METH_FASTCALL
11174 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11175 : #else
11176 : PyObject *__pyx_args, PyObject *__pyx_kwds
11177 : #endif
11178 : ); /*proto*/
11179 0 : static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11180 : #if CYTHON_METH_FASTCALL
11181 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11182 : #else
11183 : PyObject *__pyx_args, PyObject *__pyx_kwds
11184 : #endif
11185 : ) {
11186 : #if !CYTHON_METH_FASTCALL
11187 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11188 : #endif
11189 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11190 0 : PyObject *__pyx_r = 0;
11191 : __Pyx_RefNannyDeclarations
11192 0 : __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
11193 : #if !CYTHON_METH_FASTCALL
11194 : #if CYTHON_ASSUME_SAFE_MACROS
11195 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11196 : #else
11197 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11198 : #endif
11199 : #endif
11200 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11201 0 : if (unlikely(__pyx_nargs > 0)) {
11202 0 : __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL;}
11203 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_c_contig", 0))) return NULL;
11204 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11205 :
11206 : /* function exit code */
11207 0 : __Pyx_RefNannyFinishContext();
11208 0 : return __pyx_r;
11209 : }
11210 :
11211 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11212 0 : __Pyx_memviewslice *__pyx_v_mslice;
11213 0 : __Pyx_memviewslice __pyx_v_tmp;
11214 0 : PyObject *__pyx_r = NULL;
11215 : __Pyx_RefNannyDeclarations
11216 0 : __Pyx_memviewslice *__pyx_t_1;
11217 0 : PyObject *__pyx_t_2 = NULL;
11218 0 : int __pyx_lineno = 0;
11219 0 : const char *__pyx_filename = NULL;
11220 0 : int __pyx_clineno = 0;
11221 0 : __Pyx_RefNannySetupContext("is_c_contig", 1);
11222 :
11223 : /* "View.MemoryView":627
11224 : * cdef __Pyx_memviewslice *mslice
11225 : * cdef __Pyx_memviewslice tmp
11226 : * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11227 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11228 : *
11229 : */
11230 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 627, __pyx_L1_error)
11231 0 : __pyx_v_mslice = __pyx_t_1;
11232 :
11233 : /* "View.MemoryView":628
11234 : * cdef __Pyx_memviewslice tmp
11235 : * mslice = get_slice_from_memview(self, &tmp)
11236 : * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
11237 : *
11238 : * def is_f_contig(self):
11239 : */
11240 0 : __Pyx_XDECREF(__pyx_r);
11241 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 628, __pyx_L1_error)
11242 0 : __Pyx_GOTREF(__pyx_t_2);
11243 0 : __pyx_r = __pyx_t_2;
11244 0 : __pyx_t_2 = 0;
11245 0 : goto __pyx_L0;
11246 :
11247 : /* "View.MemoryView":624
11248 : *
11249 : *
11250 : * def is_c_contig(self): # <<<<<<<<<<<<<<
11251 : * cdef __Pyx_memviewslice *mslice
11252 : * cdef __Pyx_memviewslice tmp
11253 : */
11254 :
11255 : /* function exit code */
11256 0 : __pyx_L1_error:;
11257 0 : __Pyx_XDECREF(__pyx_t_2);
11258 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11259 0 : __pyx_r = NULL;
11260 0 : __pyx_L0:;
11261 0 : __Pyx_XGIVEREF(__pyx_r);
11262 0 : __Pyx_RefNannyFinishContext();
11263 0 : return __pyx_r;
11264 : }
11265 :
11266 : /* "View.MemoryView":630
11267 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11268 : *
11269 : * def is_f_contig(self): # <<<<<<<<<<<<<<
11270 : * cdef __Pyx_memviewslice *mslice
11271 : * cdef __Pyx_memviewslice tmp
11272 : */
11273 :
11274 : /* Python wrapper */
11275 : static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11276 : #if CYTHON_METH_FASTCALL
11277 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11278 : #else
11279 : PyObject *__pyx_args, PyObject *__pyx_kwds
11280 : #endif
11281 : ); /*proto*/
11282 0 : static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11283 : #if CYTHON_METH_FASTCALL
11284 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11285 : #else
11286 : PyObject *__pyx_args, PyObject *__pyx_kwds
11287 : #endif
11288 : ) {
11289 : #if !CYTHON_METH_FASTCALL
11290 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11291 : #endif
11292 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11293 0 : PyObject *__pyx_r = 0;
11294 : __Pyx_RefNannyDeclarations
11295 0 : __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
11296 : #if !CYTHON_METH_FASTCALL
11297 : #if CYTHON_ASSUME_SAFE_MACROS
11298 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11299 : #else
11300 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11301 : #endif
11302 : #endif
11303 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11304 0 : if (unlikely(__pyx_nargs > 0)) {
11305 0 : __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL;}
11306 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_f_contig", 0))) return NULL;
11307 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11308 :
11309 : /* function exit code */
11310 0 : __Pyx_RefNannyFinishContext();
11311 0 : return __pyx_r;
11312 : }
11313 :
11314 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11315 0 : __Pyx_memviewslice *__pyx_v_mslice;
11316 0 : __Pyx_memviewslice __pyx_v_tmp;
11317 0 : PyObject *__pyx_r = NULL;
11318 : __Pyx_RefNannyDeclarations
11319 0 : __Pyx_memviewslice *__pyx_t_1;
11320 0 : PyObject *__pyx_t_2 = NULL;
11321 0 : int __pyx_lineno = 0;
11322 0 : const char *__pyx_filename = NULL;
11323 0 : int __pyx_clineno = 0;
11324 0 : __Pyx_RefNannySetupContext("is_f_contig", 1);
11325 :
11326 : /* "View.MemoryView":633
11327 : * cdef __Pyx_memviewslice *mslice
11328 : * cdef __Pyx_memviewslice tmp
11329 : * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11330 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11331 : *
11332 : */
11333 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 633, __pyx_L1_error)
11334 0 : __pyx_v_mslice = __pyx_t_1;
11335 :
11336 : /* "View.MemoryView":634
11337 : * cdef __Pyx_memviewslice tmp
11338 : * mslice = get_slice_from_memview(self, &tmp)
11339 : * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
11340 : *
11341 : * def copy(self):
11342 : */
11343 0 : __Pyx_XDECREF(__pyx_r);
11344 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __pyx_L1_error)
11345 0 : __Pyx_GOTREF(__pyx_t_2);
11346 0 : __pyx_r = __pyx_t_2;
11347 0 : __pyx_t_2 = 0;
11348 0 : goto __pyx_L0;
11349 :
11350 : /* "View.MemoryView":630
11351 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11352 : *
11353 : * def is_f_contig(self): # <<<<<<<<<<<<<<
11354 : * cdef __Pyx_memviewslice *mslice
11355 : * cdef __Pyx_memviewslice tmp
11356 : */
11357 :
11358 : /* function exit code */
11359 0 : __pyx_L1_error:;
11360 0 : __Pyx_XDECREF(__pyx_t_2);
11361 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11362 0 : __pyx_r = NULL;
11363 0 : __pyx_L0:;
11364 0 : __Pyx_XGIVEREF(__pyx_r);
11365 0 : __Pyx_RefNannyFinishContext();
11366 0 : return __pyx_r;
11367 : }
11368 :
11369 : /* "View.MemoryView":636
11370 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11371 : *
11372 : * def copy(self): # <<<<<<<<<<<<<<
11373 : * cdef __Pyx_memviewslice mslice
11374 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11375 : */
11376 :
11377 : /* Python wrapper */
11378 : static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11379 : #if CYTHON_METH_FASTCALL
11380 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11381 : #else
11382 : PyObject *__pyx_args, PyObject *__pyx_kwds
11383 : #endif
11384 : ); /*proto*/
11385 0 : static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11386 : #if CYTHON_METH_FASTCALL
11387 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11388 : #else
11389 : PyObject *__pyx_args, PyObject *__pyx_kwds
11390 : #endif
11391 : ) {
11392 : #if !CYTHON_METH_FASTCALL
11393 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11394 : #endif
11395 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11396 0 : PyObject *__pyx_r = 0;
11397 : __Pyx_RefNannyDeclarations
11398 0 : __Pyx_RefNannySetupContext("copy (wrapper)", 0);
11399 : #if !CYTHON_METH_FASTCALL
11400 : #if CYTHON_ASSUME_SAFE_MACROS
11401 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11402 : #else
11403 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11404 : #endif
11405 : #endif
11406 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11407 0 : if (unlikely(__pyx_nargs > 0)) {
11408 0 : __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;}
11409 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL;
11410 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
11411 :
11412 : /* function exit code */
11413 0 : __Pyx_RefNannyFinishContext();
11414 0 : return __pyx_r;
11415 : }
11416 :
11417 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
11418 0 : __Pyx_memviewslice __pyx_v_mslice;
11419 0 : int __pyx_v_flags;
11420 0 : PyObject *__pyx_r = NULL;
11421 : __Pyx_RefNannyDeclarations
11422 0 : __Pyx_memviewslice __pyx_t_1;
11423 0 : PyObject *__pyx_t_2 = NULL;
11424 0 : int __pyx_lineno = 0;
11425 0 : const char *__pyx_filename = NULL;
11426 0 : int __pyx_clineno = 0;
11427 0 : __Pyx_RefNannySetupContext("copy", 1);
11428 :
11429 : /* "View.MemoryView":638
11430 : * def copy(self):
11431 : * cdef __Pyx_memviewslice mslice
11432 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
11433 : *
11434 : * slice_copy(self, &mslice)
11435 : */
11436 0 : __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
11437 :
11438 : /* "View.MemoryView":640
11439 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11440 : *
11441 : * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
11442 : * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
11443 : * self.view.itemsize,
11444 : */
11445 0 : __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
11446 :
11447 : /* "View.MemoryView":641
11448 : *
11449 : * slice_copy(self, &mslice)
11450 : * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
11451 : * self.view.itemsize,
11452 : * flags|PyBUF_C_CONTIGUOUS,
11453 : */
11454 0 : __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 641, __pyx_L1_error)
11455 0 : __pyx_v_mslice = __pyx_t_1;
11456 :
11457 : /* "View.MemoryView":646
11458 : * self.dtype_is_object)
11459 : *
11460 : * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
11461 : *
11462 : * def copy_fortran(self):
11463 : */
11464 0 : __Pyx_XDECREF(__pyx_r);
11465 0 : __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 646, __pyx_L1_error)
11466 0 : __Pyx_GOTREF(__pyx_t_2);
11467 0 : __pyx_r = __pyx_t_2;
11468 0 : __pyx_t_2 = 0;
11469 0 : goto __pyx_L0;
11470 :
11471 : /* "View.MemoryView":636
11472 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11473 : *
11474 : * def copy(self): # <<<<<<<<<<<<<<
11475 : * cdef __Pyx_memviewslice mslice
11476 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11477 : */
11478 :
11479 : /* function exit code */
11480 0 : __pyx_L1_error:;
11481 0 : __Pyx_XDECREF(__pyx_t_2);
11482 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
11483 0 : __pyx_r = NULL;
11484 0 : __pyx_L0:;
11485 0 : __Pyx_XGIVEREF(__pyx_r);
11486 0 : __Pyx_RefNannyFinishContext();
11487 0 : return __pyx_r;
11488 : }
11489 :
11490 : /* "View.MemoryView":648
11491 : * return memoryview_copy_from_slice(self, &mslice)
11492 : *
11493 : * def copy_fortran(self): # <<<<<<<<<<<<<<
11494 : * cdef __Pyx_memviewslice src, dst
11495 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11496 : */
11497 :
11498 : /* Python wrapper */
11499 : static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
11500 : #if CYTHON_METH_FASTCALL
11501 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11502 : #else
11503 : PyObject *__pyx_args, PyObject *__pyx_kwds
11504 : #endif
11505 : ); /*proto*/
11506 0 : static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
11507 : #if CYTHON_METH_FASTCALL
11508 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11509 : #else
11510 : PyObject *__pyx_args, PyObject *__pyx_kwds
11511 : #endif
11512 : ) {
11513 : #if !CYTHON_METH_FASTCALL
11514 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11515 : #endif
11516 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11517 0 : PyObject *__pyx_r = 0;
11518 : __Pyx_RefNannyDeclarations
11519 0 : __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
11520 : #if !CYTHON_METH_FASTCALL
11521 : #if CYTHON_ASSUME_SAFE_MACROS
11522 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11523 : #else
11524 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11525 : #endif
11526 : #endif
11527 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11528 0 : if (unlikely(__pyx_nargs > 0)) {
11529 0 : __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL;}
11530 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy_fortran", 0))) return NULL;
11531 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
11532 :
11533 : /* function exit code */
11534 0 : __Pyx_RefNannyFinishContext();
11535 0 : return __pyx_r;
11536 : }
11537 :
11538 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
11539 0 : __Pyx_memviewslice __pyx_v_src;
11540 0 : __Pyx_memviewslice __pyx_v_dst;
11541 0 : int __pyx_v_flags;
11542 0 : PyObject *__pyx_r = NULL;
11543 : __Pyx_RefNannyDeclarations
11544 0 : __Pyx_memviewslice __pyx_t_1;
11545 0 : PyObject *__pyx_t_2 = NULL;
11546 0 : int __pyx_lineno = 0;
11547 0 : const char *__pyx_filename = NULL;
11548 0 : int __pyx_clineno = 0;
11549 0 : __Pyx_RefNannySetupContext("copy_fortran", 1);
11550 :
11551 : /* "View.MemoryView":650
11552 : * def copy_fortran(self):
11553 : * cdef __Pyx_memviewslice src, dst
11554 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
11555 : *
11556 : * slice_copy(self, &src)
11557 : */
11558 0 : __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
11559 :
11560 : /* "View.MemoryView":652
11561 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11562 : *
11563 : * slice_copy(self, &src) # <<<<<<<<<<<<<<
11564 : * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
11565 : * self.view.itemsize,
11566 : */
11567 0 : __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
11568 :
11569 : /* "View.MemoryView":653
11570 : *
11571 : * slice_copy(self, &src)
11572 : * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
11573 : * self.view.itemsize,
11574 : * flags|PyBUF_F_CONTIGUOUS,
11575 : */
11576 0 : __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 653, __pyx_L1_error)
11577 0 : __pyx_v_dst = __pyx_t_1;
11578 :
11579 : /* "View.MemoryView":658
11580 : * self.dtype_is_object)
11581 : *
11582 : * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
11583 : *
11584 : *
11585 : */
11586 0 : __Pyx_XDECREF(__pyx_r);
11587 0 : __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
11588 0 : __Pyx_GOTREF(__pyx_t_2);
11589 0 : __pyx_r = __pyx_t_2;
11590 0 : __pyx_t_2 = 0;
11591 0 : goto __pyx_L0;
11592 :
11593 : /* "View.MemoryView":648
11594 : * return memoryview_copy_from_slice(self, &mslice)
11595 : *
11596 : * def copy_fortran(self): # <<<<<<<<<<<<<<
11597 : * cdef __Pyx_memviewslice src, dst
11598 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11599 : */
11600 :
11601 : /* function exit code */
11602 0 : __pyx_L1_error:;
11603 0 : __Pyx_XDECREF(__pyx_t_2);
11604 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
11605 0 : __pyx_r = NULL;
11606 0 : __pyx_L0:;
11607 0 : __Pyx_XGIVEREF(__pyx_r);
11608 0 : __Pyx_RefNannyFinishContext();
11609 0 : return __pyx_r;
11610 : }
11611 :
11612 : /* "(tree fragment)":1
11613 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11614 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11615 : * def __setstate_cython__(self, __pyx_state):
11616 : */
11617 :
11618 : /* Python wrapper */
11619 : static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
11620 : #if CYTHON_METH_FASTCALL
11621 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11622 : #else
11623 : PyObject *__pyx_args, PyObject *__pyx_kwds
11624 : #endif
11625 : ); /*proto*/
11626 0 : static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
11627 : #if CYTHON_METH_FASTCALL
11628 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11629 : #else
11630 : PyObject *__pyx_args, PyObject *__pyx_kwds
11631 : #endif
11632 : ) {
11633 : #if !CYTHON_METH_FASTCALL
11634 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11635 : #endif
11636 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11637 0 : PyObject *__pyx_r = 0;
11638 : __Pyx_RefNannyDeclarations
11639 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11640 : #if !CYTHON_METH_FASTCALL
11641 : #if CYTHON_ASSUME_SAFE_MACROS
11642 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11643 : #else
11644 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11645 : #endif
11646 : #endif
11647 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11648 0 : if (unlikely(__pyx_nargs > 0)) {
11649 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
11650 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
11651 0 : __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11652 :
11653 : /* function exit code */
11654 0 : __Pyx_RefNannyFinishContext();
11655 0 : return __pyx_r;
11656 : }
11657 :
11658 0 : static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
11659 0 : PyObject *__pyx_r = NULL;
11660 : __Pyx_RefNannyDeclarations
11661 0 : int __pyx_lineno = 0;
11662 0 : const char *__pyx_filename = NULL;
11663 0 : int __pyx_clineno = 0;
11664 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
11665 :
11666 : /* "(tree fragment)":2
11667 : * def __reduce_cython__(self):
11668 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
11669 : * def __setstate_cython__(self, __pyx_state):
11670 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11671 : */
11672 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
11673 0 : __PYX_ERR(1, 2, __pyx_L1_error)
11674 :
11675 : /* "(tree fragment)":1
11676 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11677 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11678 : * def __setstate_cython__(self, __pyx_state):
11679 : */
11680 :
11681 : /* function exit code */
11682 0 : __pyx_L1_error:;
11683 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11684 0 : __pyx_r = NULL;
11685 0 : __Pyx_XGIVEREF(__pyx_r);
11686 0 : __Pyx_RefNannyFinishContext();
11687 0 : return __pyx_r;
11688 : }
11689 :
11690 : /* "(tree fragment)":3
11691 : * def __reduce_cython__(self):
11692 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11693 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11694 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11695 : */
11696 :
11697 : /* Python wrapper */
11698 : static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
11699 : #if CYTHON_METH_FASTCALL
11700 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11701 : #else
11702 : PyObject *__pyx_args, PyObject *__pyx_kwds
11703 : #endif
11704 : ); /*proto*/
11705 0 : static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
11706 : #if CYTHON_METH_FASTCALL
11707 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11708 : #else
11709 : PyObject *__pyx_args, PyObject *__pyx_kwds
11710 : #endif
11711 : ) {
11712 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
11713 : #if !CYTHON_METH_FASTCALL
11714 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11715 : #endif
11716 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11717 0 : PyObject* values[1] = {0};
11718 0 : int __pyx_lineno = 0;
11719 0 : const char *__pyx_filename = NULL;
11720 0 : int __pyx_clineno = 0;
11721 0 : PyObject *__pyx_r = 0;
11722 : __Pyx_RefNannyDeclarations
11723 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11724 : #if !CYTHON_METH_FASTCALL
11725 : #if CYTHON_ASSUME_SAFE_MACROS
11726 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11727 : #else
11728 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11729 : #endif
11730 : #endif
11731 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11732 : {
11733 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
11734 0 : if (__pyx_kwds) {
11735 0 : Py_ssize_t kw_args;
11736 0 : switch (__pyx_nargs) {
11737 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
11738 0 : CYTHON_FALLTHROUGH;
11739 0 : case 0: break;
11740 0 : default: goto __pyx_L5_argtuple_error;
11741 : }
11742 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
11743 0 : switch (__pyx_nargs) {
11744 : case 0:
11745 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
11746 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
11747 0 : kw_args--;
11748 : }
11749 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
11750 0 : else goto __pyx_L5_argtuple_error;
11751 : }
11752 0 : if (unlikely(kw_args > 0)) {
11753 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
11754 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
11755 : }
11756 0 : } else if (unlikely(__pyx_nargs != 1)) {
11757 0 : goto __pyx_L5_argtuple_error;
11758 : } else {
11759 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
11760 : }
11761 0 : __pyx_v___pyx_state = values[0];
11762 : }
11763 0 : goto __pyx_L6_skip;
11764 0 : __pyx_L5_argtuple_error:;
11765 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
11766 0 : __pyx_L6_skip:;
11767 0 : goto __pyx_L4_argument_unpacking_done;
11768 0 : __pyx_L3_error:;
11769 : {
11770 0 : Py_ssize_t __pyx_temp;
11771 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
11772 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
11773 : }
11774 : }
11775 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11776 0 : __Pyx_RefNannyFinishContext();
11777 0 : return NULL;
11778 0 : __pyx_L4_argument_unpacking_done:;
11779 0 : __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
11780 :
11781 : /* function exit code */
11782 : {
11783 0 : Py_ssize_t __pyx_temp;
11784 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
11785 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
11786 : }
11787 : }
11788 : __Pyx_RefNannyFinishContext();
11789 : return __pyx_r;
11790 : }
11791 :
11792 0 : static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11793 0 : PyObject *__pyx_r = NULL;
11794 : __Pyx_RefNannyDeclarations
11795 0 : int __pyx_lineno = 0;
11796 0 : const char *__pyx_filename = NULL;
11797 0 : int __pyx_clineno = 0;
11798 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
11799 :
11800 : /* "(tree fragment)":4
11801 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11802 : * def __setstate_cython__(self, __pyx_state):
11803 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
11804 : */
11805 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
11806 0 : __PYX_ERR(1, 4, __pyx_L1_error)
11807 :
11808 : /* "(tree fragment)":3
11809 : * def __reduce_cython__(self):
11810 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11811 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11812 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11813 : */
11814 :
11815 : /* function exit code */
11816 0 : __pyx_L1_error:;
11817 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11818 0 : __pyx_r = NULL;
11819 0 : __Pyx_XGIVEREF(__pyx_r);
11820 0 : __Pyx_RefNannyFinishContext();
11821 0 : return __pyx_r;
11822 : }
11823 :
11824 : /* "View.MemoryView":662
11825 : *
11826 : * @cname('__pyx_memoryview_new')
11827 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
11828 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
11829 : * result.typeinfo = typeinfo
11830 : */
11831 :
11832 1964 : static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
11833 1964 : struct __pyx_memoryview_obj *__pyx_v_result = 0;
11834 1964 : PyObject *__pyx_r = NULL;
11835 : __Pyx_RefNannyDeclarations
11836 1964 : PyObject *__pyx_t_1 = NULL;
11837 1964 : PyObject *__pyx_t_2 = NULL;
11838 1964 : PyObject *__pyx_t_3 = NULL;
11839 1964 : int __pyx_lineno = 0;
11840 1964 : const char *__pyx_filename = NULL;
11841 1964 : int __pyx_clineno = 0;
11842 1964 : __Pyx_RefNannySetupContext("memoryview_cwrapper", 1);
11843 :
11844 : /* "View.MemoryView":663
11845 : * @cname('__pyx_memoryview_new')
11846 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
11847 : * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
11848 : * result.typeinfo = typeinfo
11849 : * return result
11850 : */
11851 1964 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error)
11852 1964 : __Pyx_GOTREF(__pyx_t_1);
11853 1964 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
11854 1964 : __Pyx_GOTREF(__pyx_t_2);
11855 1964 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 663, __pyx_L1_error)
11856 1964 : __Pyx_GOTREF(__pyx_t_3);
11857 1964 : __Pyx_INCREF(__pyx_v_o);
11858 1964 : __Pyx_GIVEREF(__pyx_v_o);
11859 1964 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o)) __PYX_ERR(1, 663, __pyx_L1_error);
11860 1964 : __Pyx_GIVEREF(__pyx_t_1);
11861 1964 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error);
11862 1964 : __Pyx_GIVEREF(__pyx_t_2);
11863 1964 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error);
11864 1964 : __pyx_t_1 = 0;
11865 1964 : __pyx_t_2 = 0;
11866 1964 : __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
11867 1964 : __Pyx_GOTREF(__pyx_t_2);
11868 1964 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11869 1964 : __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
11870 1964 : __pyx_t_2 = 0;
11871 :
11872 : /* "View.MemoryView":664
11873 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
11874 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
11875 : * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
11876 : * return result
11877 : *
11878 : */
11879 1964 : __pyx_v_result->typeinfo = __pyx_v_typeinfo;
11880 :
11881 : /* "View.MemoryView":665
11882 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
11883 : * result.typeinfo = typeinfo
11884 : * return result # <<<<<<<<<<<<<<
11885 : *
11886 : * @cname('__pyx_memoryview_check')
11887 : */
11888 1964 : __Pyx_XDECREF(__pyx_r);
11889 1964 : __Pyx_INCREF((PyObject *)__pyx_v_result);
11890 1964 : __pyx_r = ((PyObject *)__pyx_v_result);
11891 1964 : goto __pyx_L0;
11892 :
11893 : /* "View.MemoryView":662
11894 : *
11895 : * @cname('__pyx_memoryview_new')
11896 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
11897 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
11898 : * result.typeinfo = typeinfo
11899 : */
11900 :
11901 : /* function exit code */
11902 0 : __pyx_L1_error:;
11903 0 : __Pyx_XDECREF(__pyx_t_1);
11904 0 : __Pyx_XDECREF(__pyx_t_2);
11905 0 : __Pyx_XDECREF(__pyx_t_3);
11906 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
11907 0 : __pyx_r = 0;
11908 1964 : __pyx_L0:;
11909 1964 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
11910 1964 : __Pyx_XGIVEREF(__pyx_r);
11911 1964 : __Pyx_RefNannyFinishContext();
11912 1964 : return __pyx_r;
11913 : }
11914 :
11915 : /* "View.MemoryView":668
11916 : *
11917 : * @cname('__pyx_memoryview_check')
11918 : * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
11919 : * return isinstance(o, memoryview)
11920 : *
11921 : */
11922 :
11923 1964 : static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
11924 1964 : int __pyx_r;
11925 1964 : int __pyx_t_1;
11926 :
11927 : /* "View.MemoryView":669
11928 : * @cname('__pyx_memoryview_check')
11929 : * cdef inline bint memoryview_check(object o) noexcept:
11930 : * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
11931 : *
11932 : * cdef tuple _unellipsify(object index, int ndim):
11933 : */
11934 1964 : __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
11935 1964 : __pyx_r = __pyx_t_1;
11936 1964 : goto __pyx_L0;
11937 :
11938 : /* "View.MemoryView":668
11939 : *
11940 : * @cname('__pyx_memoryview_check')
11941 : * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
11942 : * return isinstance(o, memoryview)
11943 : *
11944 : */
11945 :
11946 : /* function exit code */
11947 1964 : __pyx_L0:;
11948 1964 : return __pyx_r;
11949 : }
11950 :
11951 : /* "View.MemoryView":671
11952 : * return isinstance(o, memoryview)
11953 : *
11954 : * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
11955 : * """
11956 : * Replace all ellipses with full slices and fill incomplete indices with
11957 : */
11958 :
11959 0 : static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
11960 0 : Py_ssize_t __pyx_v_idx;
11961 0 : PyObject *__pyx_v_tup = NULL;
11962 0 : PyObject *__pyx_v_result = NULL;
11963 0 : int __pyx_v_have_slices;
11964 0 : int __pyx_v_seen_ellipsis;
11965 0 : PyObject *__pyx_v_item = NULL;
11966 0 : Py_ssize_t __pyx_v_nslices;
11967 0 : PyObject *__pyx_r = NULL;
11968 : __Pyx_RefNannyDeclarations
11969 0 : PyObject *__pyx_t_1 = NULL;
11970 0 : int __pyx_t_2;
11971 0 : PyObject *__pyx_t_3 = NULL;
11972 0 : Py_ssize_t __pyx_t_4;
11973 0 : Py_ssize_t __pyx_t_5;
11974 0 : Py_UCS4 __pyx_t_6;
11975 0 : PyObject *__pyx_t_7 = NULL;
11976 0 : int __pyx_lineno = 0;
11977 0 : const char *__pyx_filename = NULL;
11978 0 : int __pyx_clineno = 0;
11979 0 : __Pyx_RefNannySetupContext("_unellipsify", 1);
11980 :
11981 : /* "View.MemoryView":677
11982 : * """
11983 : * cdef Py_ssize_t idx
11984 : * tup = <tuple>index if isinstance(index, tuple) else (index,) # <<<<<<<<<<<<<<
11985 : *
11986 : * result = [slice(None)] * ndim
11987 : */
11988 0 : __pyx_t_2 = PyTuple_Check(__pyx_v_index);
11989 0 : if (__pyx_t_2) {
11990 0 : __Pyx_INCREF(((PyObject*)__pyx_v_index));
11991 : __pyx_t_1 = __pyx_v_index;
11992 : } else {
11993 0 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 677, __pyx_L1_error)
11994 0 : __Pyx_GOTREF(__pyx_t_3);
11995 0 : __Pyx_INCREF(__pyx_v_index);
11996 0 : __Pyx_GIVEREF(__pyx_v_index);
11997 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index)) __PYX_ERR(1, 677, __pyx_L1_error);
11998 0 : __pyx_t_1 = __pyx_t_3;
11999 0 : __pyx_t_3 = 0;
12000 : }
12001 0 : __pyx_v_tup = ((PyObject*)__pyx_t_1);
12002 0 : __pyx_t_1 = 0;
12003 :
12004 : /* "View.MemoryView":679
12005 : * tup = <tuple>index if isinstance(index, tuple) else (index,)
12006 : *
12007 : * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
12008 : * have_slices = False
12009 : * seen_ellipsis = False
12010 : */
12011 0 : __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 679, __pyx_L1_error)
12012 : __Pyx_GOTREF(__pyx_t_1);
12013 : { Py_ssize_t __pyx_temp;
12014 0 : for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
12015 0 : __Pyx_INCREF(__pyx_slice__5);
12016 0 : __Pyx_GIVEREF(__pyx_slice__5);
12017 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_slice__5)) __PYX_ERR(1, 679, __pyx_L1_error);
12018 : }
12019 : }
12020 0 : __pyx_v_result = ((PyObject*)__pyx_t_1);
12021 0 : __pyx_t_1 = 0;
12022 :
12023 : /* "View.MemoryView":680
12024 : *
12025 : * result = [slice(None)] * ndim
12026 : * have_slices = False # <<<<<<<<<<<<<<
12027 : * seen_ellipsis = False
12028 : * idx = 0
12029 : */
12030 0 : __pyx_v_have_slices = 0;
12031 :
12032 : /* "View.MemoryView":681
12033 : * result = [slice(None)] * ndim
12034 : * have_slices = False
12035 : * seen_ellipsis = False # <<<<<<<<<<<<<<
12036 : * idx = 0
12037 : * for item in tup:
12038 : */
12039 0 : __pyx_v_seen_ellipsis = 0;
12040 :
12041 : /* "View.MemoryView":682
12042 : * have_slices = False
12043 : * seen_ellipsis = False
12044 : * idx = 0 # <<<<<<<<<<<<<<
12045 : * for item in tup:
12046 : * if item is Ellipsis:
12047 : */
12048 0 : __pyx_v_idx = 0;
12049 :
12050 : /* "View.MemoryView":683
12051 : * seen_ellipsis = False
12052 : * idx = 0
12053 : * for item in tup: # <<<<<<<<<<<<<<
12054 : * if item is Ellipsis:
12055 : * if not seen_ellipsis:
12056 : */
12057 0 : if (unlikely(__pyx_v_tup == Py_None)) {
12058 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
12059 0 : __PYX_ERR(1, 683, __pyx_L1_error)
12060 : }
12061 0 : __pyx_t_1 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_1);
12062 : __pyx_t_4 = 0;
12063 0 : for (;;) {
12064 0 : {
12065 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
12066 : #if !CYTHON_ASSUME_SAFE_MACROS
12067 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
12068 : #endif
12069 0 : if (__pyx_t_4 >= __pyx_temp) break;
12070 : }
12071 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12072 0 : __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
12073 : #else
12074 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 683, __pyx_L1_error)
12075 : __Pyx_GOTREF(__pyx_t_3);
12076 : #endif
12077 0 : __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
12078 0 : __pyx_t_3 = 0;
12079 :
12080 : /* "View.MemoryView":684
12081 : * idx = 0
12082 : * for item in tup:
12083 : * if item is Ellipsis: # <<<<<<<<<<<<<<
12084 : * if not seen_ellipsis:
12085 : * idx += ndim - len(tup)
12086 : */
12087 0 : __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12088 0 : if (__pyx_t_2) {
12089 :
12090 : /* "View.MemoryView":685
12091 : * for item in tup:
12092 : * if item is Ellipsis:
12093 : * if not seen_ellipsis: # <<<<<<<<<<<<<<
12094 : * idx += ndim - len(tup)
12095 : * seen_ellipsis = True
12096 : */
12097 0 : __pyx_t_2 = (!__pyx_v_seen_ellipsis);
12098 0 : if (__pyx_t_2) {
12099 :
12100 : /* "View.MemoryView":686
12101 : * if item is Ellipsis:
12102 : * if not seen_ellipsis:
12103 : * idx += ndim - len(tup) # <<<<<<<<<<<<<<
12104 : * seen_ellipsis = True
12105 : * have_slices = True
12106 : */
12107 0 : if (unlikely(__pyx_v_tup == Py_None)) {
12108 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
12109 : __PYX_ERR(1, 686, __pyx_L1_error)
12110 : }
12111 0 : __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v_tup); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 686, __pyx_L1_error)
12112 0 : __pyx_v_idx = (__pyx_v_idx + (__pyx_v_ndim - __pyx_t_5));
12113 :
12114 : /* "View.MemoryView":687
12115 : * if not seen_ellipsis:
12116 : * idx += ndim - len(tup)
12117 : * seen_ellipsis = True # <<<<<<<<<<<<<<
12118 : * have_slices = True
12119 : * else:
12120 : */
12121 0 : __pyx_v_seen_ellipsis = 1;
12122 :
12123 : /* "View.MemoryView":685
12124 : * for item in tup:
12125 : * if item is Ellipsis:
12126 : * if not seen_ellipsis: # <<<<<<<<<<<<<<
12127 : * idx += ndim - len(tup)
12128 : * seen_ellipsis = True
12129 : */
12130 : }
12131 :
12132 : /* "View.MemoryView":688
12133 : * idx += ndim - len(tup)
12134 : * seen_ellipsis = True
12135 : * have_slices = True # <<<<<<<<<<<<<<
12136 : * else:
12137 : * if isinstance(item, slice):
12138 : */
12139 0 : __pyx_v_have_slices = 1;
12140 :
12141 : /* "View.MemoryView":684
12142 : * idx = 0
12143 : * for item in tup:
12144 : * if item is Ellipsis: # <<<<<<<<<<<<<<
12145 : * if not seen_ellipsis:
12146 : * idx += ndim - len(tup)
12147 : */
12148 0 : goto __pyx_L5;
12149 : }
12150 :
12151 : /* "View.MemoryView":690
12152 : * have_slices = True
12153 : * else:
12154 : * if isinstance(item, slice): # <<<<<<<<<<<<<<
12155 : * have_slices = True
12156 : * elif not PyIndex_Check(item):
12157 : */
12158 : /*else*/ {
12159 0 : __pyx_t_2 = PySlice_Check(__pyx_v_item);
12160 0 : if (__pyx_t_2) {
12161 :
12162 : /* "View.MemoryView":691
12163 : * else:
12164 : * if isinstance(item, slice):
12165 : * have_slices = True # <<<<<<<<<<<<<<
12166 : * elif not PyIndex_Check(item):
12167 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12168 : */
12169 0 : __pyx_v_have_slices = 1;
12170 :
12171 : /* "View.MemoryView":690
12172 : * have_slices = True
12173 : * else:
12174 : * if isinstance(item, slice): # <<<<<<<<<<<<<<
12175 : * have_slices = True
12176 : * elif not PyIndex_Check(item):
12177 : */
12178 0 : goto __pyx_L7;
12179 : }
12180 :
12181 : /* "View.MemoryView":692
12182 : * if isinstance(item, slice):
12183 : * have_slices = True
12184 : * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
12185 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12186 : * result[idx] = item
12187 : */
12188 0 : __pyx_t_2 = (!(PyIndex_Check(__pyx_v_item) != 0));
12189 0 : if (unlikely(__pyx_t_2)) {
12190 :
12191 : /* "View.MemoryView":693
12192 : * have_slices = True
12193 : * elif not PyIndex_Check(item):
12194 : * raise TypeError, f"Cannot index with type '{type(item)}'" # <<<<<<<<<<<<<<
12195 : * result[idx] = item
12196 : * idx += 1
12197 : */
12198 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 693, __pyx_L1_error)
12199 0 : __Pyx_GOTREF(__pyx_t_3);
12200 0 : __pyx_t_5 = 0;
12201 0 : __pyx_t_6 = 127;
12202 0 : __Pyx_INCREF(__pyx_kp_u_Cannot_index_with_type);
12203 0 : __pyx_t_5 += 24;
12204 0 : __Pyx_GIVEREF(__pyx_kp_u_Cannot_index_with_type);
12205 0 : PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Cannot_index_with_type);
12206 0 : __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
12207 0 : __Pyx_GOTREF(__pyx_t_7);
12208 0 : __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
12209 0 : __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
12210 0 : __Pyx_GIVEREF(__pyx_t_7);
12211 0 : PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
12212 0 : __pyx_t_7 = 0;
12213 0 : __Pyx_INCREF(__pyx_kp_u__6);
12214 0 : __pyx_t_5 += 1;
12215 0 : __Pyx_GIVEREF(__pyx_kp_u__6);
12216 0 : PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__6);
12217 0 : __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
12218 0 : __Pyx_GOTREF(__pyx_t_7);
12219 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12220 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_7, 0, 0);
12221 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12222 0 : __PYX_ERR(1, 693, __pyx_L1_error)
12223 :
12224 : /* "View.MemoryView":692
12225 : * if isinstance(item, slice):
12226 : * have_slices = True
12227 : * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
12228 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12229 : * result[idx] = item
12230 : */
12231 : }
12232 0 : __pyx_L7:;
12233 :
12234 : /* "View.MemoryView":694
12235 : * elif not PyIndex_Check(item):
12236 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12237 : * result[idx] = item # <<<<<<<<<<<<<<
12238 : * idx += 1
12239 : *
12240 : */
12241 0 : if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_v_item, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0))) __PYX_ERR(1, 694, __pyx_L1_error)
12242 : }
12243 0 : __pyx_L5:;
12244 :
12245 : /* "View.MemoryView":695
12246 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12247 : * result[idx] = item
12248 : * idx += 1 # <<<<<<<<<<<<<<
12249 : *
12250 : * nslices = ndim - idx
12251 : */
12252 0 : __pyx_v_idx = (__pyx_v_idx + 1);
12253 :
12254 : /* "View.MemoryView":683
12255 : * seen_ellipsis = False
12256 : * idx = 0
12257 : * for item in tup: # <<<<<<<<<<<<<<
12258 : * if item is Ellipsis:
12259 : * if not seen_ellipsis:
12260 : */
12261 : }
12262 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12263 :
12264 : /* "View.MemoryView":697
12265 : * idx += 1
12266 : *
12267 : * nslices = ndim - idx # <<<<<<<<<<<<<<
12268 : * return have_slices or nslices, tuple(result)
12269 : *
12270 : */
12271 0 : __pyx_v_nslices = (__pyx_v_ndim - __pyx_v_idx);
12272 :
12273 : /* "View.MemoryView":698
12274 : *
12275 : * nslices = ndim - idx
12276 : * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
12277 : *
12278 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12279 : */
12280 0 : __Pyx_XDECREF(__pyx_r);
12281 0 : if (!__pyx_v_have_slices) {
12282 0 : } else {
12283 0 : __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
12284 0 : __Pyx_GOTREF(__pyx_t_7);
12285 0 : __pyx_t_1 = __pyx_t_7;
12286 0 : __pyx_t_7 = 0;
12287 0 : goto __pyx_L9_bool_binop_done;
12288 : }
12289 0 : __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
12290 : __Pyx_GOTREF(__pyx_t_7);
12291 : __pyx_t_1 = __pyx_t_7;
12292 0 : __pyx_t_7 = 0;
12293 0 : __pyx_L9_bool_binop_done:;
12294 0 : __pyx_t_7 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
12295 0 : __Pyx_GOTREF(__pyx_t_7);
12296 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
12297 0 : __Pyx_GOTREF(__pyx_t_3);
12298 0 : __Pyx_GIVEREF(__pyx_t_1);
12299 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 698, __pyx_L1_error);
12300 0 : __Pyx_GIVEREF(__pyx_t_7);
12301 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error);
12302 0 : __pyx_t_1 = 0;
12303 0 : __pyx_t_7 = 0;
12304 0 : __pyx_r = ((PyObject*)__pyx_t_3);
12305 0 : __pyx_t_3 = 0;
12306 0 : goto __pyx_L0;
12307 :
12308 : /* "View.MemoryView":671
12309 : * return isinstance(o, memoryview)
12310 : *
12311 : * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
12312 : * """
12313 : * Replace all ellipses with full slices and fill incomplete indices with
12314 : */
12315 :
12316 : /* function exit code */
12317 0 : __pyx_L1_error:;
12318 0 : __Pyx_XDECREF(__pyx_t_1);
12319 0 : __Pyx_XDECREF(__pyx_t_3);
12320 0 : __Pyx_XDECREF(__pyx_t_7);
12321 0 : __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
12322 0 : __pyx_r = 0;
12323 0 : __pyx_L0:;
12324 0 : __Pyx_XDECREF(__pyx_v_tup);
12325 0 : __Pyx_XDECREF(__pyx_v_result);
12326 0 : __Pyx_XDECREF(__pyx_v_item);
12327 0 : __Pyx_XGIVEREF(__pyx_r);
12328 0 : __Pyx_RefNannyFinishContext();
12329 0 : return __pyx_r;
12330 : }
12331 :
12332 : /* "View.MemoryView":700
12333 : * return have_slices or nslices, tuple(result)
12334 : *
12335 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
12336 : * for suboffset in suboffsets[:ndim]:
12337 : * if suboffset >= 0:
12338 : */
12339 :
12340 0 : static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
12341 0 : Py_ssize_t __pyx_v_suboffset;
12342 0 : int __pyx_r;
12343 0 : Py_ssize_t *__pyx_t_1;
12344 0 : Py_ssize_t *__pyx_t_2;
12345 0 : Py_ssize_t *__pyx_t_3;
12346 0 : int __pyx_t_4;
12347 0 : int __pyx_lineno = 0;
12348 0 : const char *__pyx_filename = NULL;
12349 0 : int __pyx_clineno = 0;
12350 :
12351 : /* "View.MemoryView":701
12352 : *
12353 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12354 : * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
12355 : * if suboffset >= 0:
12356 : * raise ValueError, "Indirect dimensions not supported"
12357 : */
12358 0 : __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
12359 0 : for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
12360 0 : __pyx_t_1 = __pyx_t_3;
12361 0 : __pyx_v_suboffset = (__pyx_t_1[0]);
12362 :
12363 : /* "View.MemoryView":702
12364 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12365 : * for suboffset in suboffsets[:ndim]:
12366 : * if suboffset >= 0: # <<<<<<<<<<<<<<
12367 : * raise ValueError, "Indirect dimensions not supported"
12368 : * return 0 # return type just used as an error flag
12369 : */
12370 0 : __pyx_t_4 = (__pyx_v_suboffset >= 0);
12371 0 : if (unlikely(__pyx_t_4)) {
12372 :
12373 : /* "View.MemoryView":703
12374 : * for suboffset in suboffsets[:ndim]:
12375 : * if suboffset >= 0:
12376 : * raise ValueError, "Indirect dimensions not supported" # <<<<<<<<<<<<<<
12377 : * return 0 # return type just used as an error flag
12378 : *
12379 : */
12380 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Indirect_dimensions_not_supporte, 0, 0);
12381 0 : __PYX_ERR(1, 703, __pyx_L1_error)
12382 :
12383 : /* "View.MemoryView":702
12384 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12385 : * for suboffset in suboffsets[:ndim]:
12386 : * if suboffset >= 0: # <<<<<<<<<<<<<<
12387 : * raise ValueError, "Indirect dimensions not supported"
12388 : * return 0 # return type just used as an error flag
12389 : */
12390 : }
12391 : }
12392 :
12393 : /* "View.MemoryView":704
12394 : * if suboffset >= 0:
12395 : * raise ValueError, "Indirect dimensions not supported"
12396 : * return 0 # return type just used as an error flag # <<<<<<<<<<<<<<
12397 : *
12398 : *
12399 : */
12400 0 : __pyx_r = 0;
12401 0 : goto __pyx_L0;
12402 :
12403 : /* "View.MemoryView":700
12404 : * return have_slices or nslices, tuple(result)
12405 : *
12406 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
12407 : * for suboffset in suboffsets[:ndim]:
12408 : * if suboffset >= 0:
12409 : */
12410 :
12411 : /* function exit code */
12412 0 : __pyx_L1_error:;
12413 0 : __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
12414 0 : __pyx_r = -1;
12415 0 : __pyx_L0:;
12416 0 : return __pyx_r;
12417 : }
12418 :
12419 : /* "View.MemoryView":711
12420 : *
12421 : * @cname('__pyx_memview_slice')
12422 : * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
12423 : * cdef int new_ndim = 0, suboffset_dim = -1, dim
12424 : * cdef bint negative_step
12425 : */
12426 :
12427 0 : static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
12428 0 : int __pyx_v_new_ndim;
12429 0 : int __pyx_v_suboffset_dim;
12430 0 : int __pyx_v_dim;
12431 0 : __Pyx_memviewslice __pyx_v_src;
12432 0 : __Pyx_memviewslice __pyx_v_dst;
12433 0 : __Pyx_memviewslice *__pyx_v_p_src;
12434 0 : struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
12435 0 : __Pyx_memviewslice *__pyx_v_p_dst;
12436 0 : int *__pyx_v_p_suboffset_dim;
12437 0 : Py_ssize_t __pyx_v_start;
12438 0 : Py_ssize_t __pyx_v_stop;
12439 0 : Py_ssize_t __pyx_v_step;
12440 0 : Py_ssize_t __pyx_v_cindex;
12441 0 : int __pyx_v_have_start;
12442 0 : int __pyx_v_have_stop;
12443 0 : int __pyx_v_have_step;
12444 0 : PyObject *__pyx_v_index = NULL;
12445 0 : struct __pyx_memoryview_obj *__pyx_r = NULL;
12446 : __Pyx_RefNannyDeclarations
12447 0 : int __pyx_t_1;
12448 0 : PyObject *__pyx_t_2 = NULL;
12449 0 : struct __pyx_memoryview_obj *__pyx_t_3;
12450 0 : char *__pyx_t_4;
12451 0 : int __pyx_t_5;
12452 0 : Py_ssize_t __pyx_t_6;
12453 0 : PyObject *(*__pyx_t_7)(PyObject *);
12454 0 : PyObject *__pyx_t_8 = NULL;
12455 0 : Py_ssize_t __pyx_t_9;
12456 0 : int __pyx_t_10;
12457 0 : Py_ssize_t __pyx_t_11;
12458 0 : int __pyx_lineno = 0;
12459 0 : const char *__pyx_filename = NULL;
12460 0 : int __pyx_clineno = 0;
12461 0 : __Pyx_RefNannySetupContext("memview_slice", 1);
12462 :
12463 : /* "View.MemoryView":712
12464 : * @cname('__pyx_memview_slice')
12465 : * cdef memoryview memview_slice(memoryview memview, object indices):
12466 : * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
12467 : * cdef bint negative_step
12468 : * cdef __Pyx_memviewslice src, dst
12469 : */
12470 0 : __pyx_v_new_ndim = 0;
12471 0 : __pyx_v_suboffset_dim = -1;
12472 :
12473 : /* "View.MemoryView":719
12474 : *
12475 : *
12476 : * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
12477 : *
12478 : * cdef _memoryviewslice memviewsliceobj
12479 : */
12480 0 : (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
12481 :
12482 : /* "View.MemoryView":723
12483 : * cdef _memoryviewslice memviewsliceobj
12484 : *
12485 : * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
12486 : *
12487 : * if isinstance(memview, _memoryviewslice):
12488 : */
12489 : #ifndef CYTHON_WITHOUT_ASSERTIONS
12490 0 : if (unlikely(__pyx_assertions_enabled())) {
12491 0 : __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
12492 0 : if (unlikely(!__pyx_t_1)) {
12493 0 : __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
12494 0 : __PYX_ERR(1, 723, __pyx_L1_error)
12495 : }
12496 : }
12497 : #else
12498 : if ((1)); else __PYX_ERR(1, 723, __pyx_L1_error)
12499 : #endif
12500 :
12501 : /* "View.MemoryView":725
12502 : * assert memview.view.ndim > 0
12503 : *
12504 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12505 : * memviewsliceobj = memview
12506 : * p_src = &memviewsliceobj.from_slice
12507 : */
12508 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
12509 0 : if (__pyx_t_1) {
12510 :
12511 : /* "View.MemoryView":726
12512 : *
12513 : * if isinstance(memview, _memoryviewslice):
12514 : * memviewsliceobj = memview # <<<<<<<<<<<<<<
12515 : * p_src = &memviewsliceobj.from_slice
12516 : * else:
12517 : */
12518 0 : if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 726, __pyx_L1_error)
12519 0 : __pyx_t_2 = ((PyObject *)__pyx_v_memview);
12520 0 : __Pyx_INCREF(__pyx_t_2);
12521 0 : __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
12522 0 : __pyx_t_2 = 0;
12523 :
12524 : /* "View.MemoryView":727
12525 : * if isinstance(memview, _memoryviewslice):
12526 : * memviewsliceobj = memview
12527 : * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
12528 : * else:
12529 : * slice_copy(memview, &src)
12530 : */
12531 0 : __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
12532 :
12533 : /* "View.MemoryView":725
12534 : * assert memview.view.ndim > 0
12535 : *
12536 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12537 : * memviewsliceobj = memview
12538 : * p_src = &memviewsliceobj.from_slice
12539 : */
12540 0 : goto __pyx_L3;
12541 : }
12542 :
12543 : /* "View.MemoryView":729
12544 : * p_src = &memviewsliceobj.from_slice
12545 : * else:
12546 : * slice_copy(memview, &src) # <<<<<<<<<<<<<<
12547 : * p_src = &src
12548 : *
12549 : */
12550 : /*else*/ {
12551 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
12552 :
12553 : /* "View.MemoryView":730
12554 : * else:
12555 : * slice_copy(memview, &src)
12556 : * p_src = &src # <<<<<<<<<<<<<<
12557 : *
12558 : *
12559 : */
12560 0 : __pyx_v_p_src = (&__pyx_v_src);
12561 : }
12562 0 : __pyx_L3:;
12563 :
12564 : /* "View.MemoryView":736
12565 : *
12566 : *
12567 : * dst.memview = p_src.memview # <<<<<<<<<<<<<<
12568 : * dst.data = p_src.data
12569 : *
12570 : */
12571 0 : __pyx_t_3 = __pyx_v_p_src->memview;
12572 0 : __pyx_v_dst.memview = __pyx_t_3;
12573 :
12574 : /* "View.MemoryView":737
12575 : *
12576 : * dst.memview = p_src.memview
12577 : * dst.data = p_src.data # <<<<<<<<<<<<<<
12578 : *
12579 : *
12580 : */
12581 0 : __pyx_t_4 = __pyx_v_p_src->data;
12582 0 : __pyx_v_dst.data = __pyx_t_4;
12583 :
12584 : /* "View.MemoryView":742
12585 : *
12586 : *
12587 : * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
12588 : * cdef int *p_suboffset_dim = &suboffset_dim
12589 : * cdef Py_ssize_t start, stop, step, cindex
12590 : */
12591 0 : __pyx_v_p_dst = (&__pyx_v_dst);
12592 :
12593 : /* "View.MemoryView":743
12594 : *
12595 : * cdef __Pyx_memviewslice *p_dst = &dst
12596 : * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
12597 : * cdef Py_ssize_t start, stop, step, cindex
12598 : * cdef bint have_start, have_stop, have_step
12599 : */
12600 0 : __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
12601 :
12602 : /* "View.MemoryView":747
12603 : * cdef bint have_start, have_stop, have_step
12604 : *
12605 : * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
12606 : * if PyIndex_Check(index):
12607 : * cindex = index
12608 : */
12609 0 : __pyx_t_5 = 0;
12610 0 : if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
12611 0 : __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
12612 0 : __pyx_t_6 = 0;
12613 0 : __pyx_t_7 = NULL;
12614 : } else {
12615 0 : __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 747, __pyx_L1_error)
12616 0 : __Pyx_GOTREF(__pyx_t_2);
12617 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 747, __pyx_L1_error)
12618 : }
12619 0 : for (;;) {
12620 0 : if (likely(!__pyx_t_7)) {
12621 0 : if (likely(PyList_CheckExact(__pyx_t_2))) {
12622 : {
12623 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
12624 : #if !CYTHON_ASSUME_SAFE_MACROS
12625 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12626 : #endif
12627 0 : if (__pyx_t_6 >= __pyx_temp) break;
12628 : }
12629 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12630 0 : __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12631 : #else
12632 : __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
12633 : __Pyx_GOTREF(__pyx_t_8);
12634 : #endif
12635 : } else {
12636 : {
12637 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
12638 : #if !CYTHON_ASSUME_SAFE_MACROS
12639 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12640 : #endif
12641 0 : if (__pyx_t_6 >= __pyx_temp) break;
12642 : }
12643 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12644 0 : __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12645 : #else
12646 : __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
12647 : __Pyx_GOTREF(__pyx_t_8);
12648 : #endif
12649 : }
12650 : } else {
12651 0 : __pyx_t_8 = __pyx_t_7(__pyx_t_2);
12652 0 : if (unlikely(!__pyx_t_8)) {
12653 0 : PyObject* exc_type = PyErr_Occurred();
12654 0 : if (exc_type) {
12655 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12656 0 : else __PYX_ERR(1, 747, __pyx_L1_error)
12657 : }
12658 : break;
12659 : }
12660 0 : __Pyx_GOTREF(__pyx_t_8);
12661 : }
12662 0 : __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8);
12663 0 : __pyx_t_8 = 0;
12664 0 : __pyx_v_dim = __pyx_t_5;
12665 0 : __pyx_t_5 = (__pyx_t_5 + 1);
12666 :
12667 : /* "View.MemoryView":748
12668 : *
12669 : * for dim, index in enumerate(indices):
12670 : * if PyIndex_Check(index): # <<<<<<<<<<<<<<
12671 : * cindex = index
12672 : * slice_memviewslice(
12673 : */
12674 0 : __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
12675 0 : if (__pyx_t_1) {
12676 :
12677 : /* "View.MemoryView":749
12678 : * for dim, index in enumerate(indices):
12679 : * if PyIndex_Check(index):
12680 : * cindex = index # <<<<<<<<<<<<<<
12681 : * slice_memviewslice(
12682 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12683 : */
12684 0 : __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 749, __pyx_L1_error)
12685 0 : __pyx_v_cindex = __pyx_t_9;
12686 :
12687 : /* "View.MemoryView":750
12688 : * if PyIndex_Check(index):
12689 : * cindex = index
12690 : * slice_memviewslice( # <<<<<<<<<<<<<<
12691 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12692 : * dim, new_ndim, p_suboffset_dim,
12693 : */
12694 0 : __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
12695 :
12696 : /* "View.MemoryView":748
12697 : *
12698 : * for dim, index in enumerate(indices):
12699 : * if PyIndex_Check(index): # <<<<<<<<<<<<<<
12700 : * cindex = index
12701 : * slice_memviewslice(
12702 : */
12703 0 : goto __pyx_L6;
12704 : }
12705 :
12706 : /* "View.MemoryView":756
12707 : * 0, 0, 0, # have_{start,stop,step}
12708 : * False)
12709 : * elif index is None: # <<<<<<<<<<<<<<
12710 : * p_dst.shape[new_ndim] = 1
12711 : * p_dst.strides[new_ndim] = 0
12712 : */
12713 0 : __pyx_t_1 = (__pyx_v_index == Py_None);
12714 0 : if (__pyx_t_1) {
12715 :
12716 : /* "View.MemoryView":757
12717 : * False)
12718 : * elif index is None:
12719 : * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
12720 : * p_dst.strides[new_ndim] = 0
12721 : * p_dst.suboffsets[new_ndim] = -1
12722 : */
12723 0 : (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
12724 :
12725 : /* "View.MemoryView":758
12726 : * elif index is None:
12727 : * p_dst.shape[new_ndim] = 1
12728 : * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
12729 : * p_dst.suboffsets[new_ndim] = -1
12730 : * new_ndim += 1
12731 : */
12732 0 : (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
12733 :
12734 : /* "View.MemoryView":759
12735 : * p_dst.shape[new_ndim] = 1
12736 : * p_dst.strides[new_ndim] = 0
12737 : * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
12738 : * new_ndim += 1
12739 : * else:
12740 : */
12741 0 : (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
12742 :
12743 : /* "View.MemoryView":760
12744 : * p_dst.strides[new_ndim] = 0
12745 : * p_dst.suboffsets[new_ndim] = -1
12746 : * new_ndim += 1 # <<<<<<<<<<<<<<
12747 : * else:
12748 : * start = index.start or 0
12749 : */
12750 0 : __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
12751 :
12752 : /* "View.MemoryView":756
12753 : * 0, 0, 0, # have_{start,stop,step}
12754 : * False)
12755 : * elif index is None: # <<<<<<<<<<<<<<
12756 : * p_dst.shape[new_ndim] = 1
12757 : * p_dst.strides[new_ndim] = 0
12758 : */
12759 0 : goto __pyx_L6;
12760 : }
12761 :
12762 : /* "View.MemoryView":762
12763 : * new_ndim += 1
12764 : * else:
12765 : * start = index.start or 0 # <<<<<<<<<<<<<<
12766 : * stop = index.stop or 0
12767 : * step = index.step or 0
12768 : */
12769 : /*else*/ {
12770 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 762, __pyx_L1_error)
12771 0 : __Pyx_GOTREF(__pyx_t_8);
12772 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 762, __pyx_L1_error)
12773 0 : if (!__pyx_t_1) {
12774 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12775 : } else {
12776 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
12777 0 : __pyx_t_9 = __pyx_t_11;
12778 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12779 0 : goto __pyx_L7_bool_binop_done;
12780 : }
12781 : __pyx_t_9 = 0;
12782 0 : __pyx_L7_bool_binop_done:;
12783 0 : __pyx_v_start = __pyx_t_9;
12784 :
12785 : /* "View.MemoryView":763
12786 : * else:
12787 : * start = index.start or 0
12788 : * stop = index.stop or 0 # <<<<<<<<<<<<<<
12789 : * step = index.step or 0
12790 : *
12791 : */
12792 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 763, __pyx_L1_error)
12793 0 : __Pyx_GOTREF(__pyx_t_8);
12794 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 763, __pyx_L1_error)
12795 0 : if (!__pyx_t_1) {
12796 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12797 : } else {
12798 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
12799 0 : __pyx_t_9 = __pyx_t_11;
12800 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12801 0 : goto __pyx_L9_bool_binop_done;
12802 : }
12803 : __pyx_t_9 = 0;
12804 0 : __pyx_L9_bool_binop_done:;
12805 0 : __pyx_v_stop = __pyx_t_9;
12806 :
12807 : /* "View.MemoryView":764
12808 : * start = index.start or 0
12809 : * stop = index.stop or 0
12810 : * step = index.step or 0 # <<<<<<<<<<<<<<
12811 : *
12812 : * have_start = index.start is not None
12813 : */
12814 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 764, __pyx_L1_error)
12815 0 : __Pyx_GOTREF(__pyx_t_8);
12816 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
12817 0 : if (!__pyx_t_1) {
12818 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12819 : } else {
12820 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
12821 0 : __pyx_t_9 = __pyx_t_11;
12822 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12823 0 : goto __pyx_L11_bool_binop_done;
12824 : }
12825 : __pyx_t_9 = 0;
12826 0 : __pyx_L11_bool_binop_done:;
12827 0 : __pyx_v_step = __pyx_t_9;
12828 :
12829 : /* "View.MemoryView":766
12830 : * step = index.step or 0
12831 : *
12832 : * have_start = index.start is not None # <<<<<<<<<<<<<<
12833 : * have_stop = index.stop is not None
12834 : * have_step = index.step is not None
12835 : */
12836 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 766, __pyx_L1_error)
12837 0 : __Pyx_GOTREF(__pyx_t_8);
12838 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
12839 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12840 0 : __pyx_v_have_start = __pyx_t_1;
12841 :
12842 : /* "View.MemoryView":767
12843 : *
12844 : * have_start = index.start is not None
12845 : * have_stop = index.stop is not None # <<<<<<<<<<<<<<
12846 : * have_step = index.step is not None
12847 : *
12848 : */
12849 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 767, __pyx_L1_error)
12850 0 : __Pyx_GOTREF(__pyx_t_8);
12851 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
12852 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12853 0 : __pyx_v_have_stop = __pyx_t_1;
12854 :
12855 : /* "View.MemoryView":768
12856 : * have_start = index.start is not None
12857 : * have_stop = index.stop is not None
12858 : * have_step = index.step is not None # <<<<<<<<<<<<<<
12859 : *
12860 : * slice_memviewslice(
12861 : */
12862 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 768, __pyx_L1_error)
12863 0 : __Pyx_GOTREF(__pyx_t_8);
12864 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
12865 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12866 0 : __pyx_v_have_step = __pyx_t_1;
12867 :
12868 : /* "View.MemoryView":770
12869 : * have_step = index.step is not None
12870 : *
12871 : * slice_memviewslice( # <<<<<<<<<<<<<<
12872 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12873 : * dim, new_ndim, p_suboffset_dim,
12874 : */
12875 0 : __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
12876 :
12877 : /* "View.MemoryView":776
12878 : * have_start, have_stop, have_step,
12879 : * True)
12880 : * new_ndim += 1 # <<<<<<<<<<<<<<
12881 : *
12882 : * if isinstance(memview, _memoryviewslice):
12883 : */
12884 0 : __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
12885 : }
12886 0 : __pyx_L6:;
12887 :
12888 : /* "View.MemoryView":747
12889 : * cdef bint have_start, have_stop, have_step
12890 : *
12891 : * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
12892 : * if PyIndex_Check(index):
12893 : * cindex = index
12894 : */
12895 : }
12896 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12897 :
12898 : /* "View.MemoryView":778
12899 : * new_ndim += 1
12900 : *
12901 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12902 : * return memoryview_fromslice(dst, new_ndim,
12903 : * memviewsliceobj.to_object_func,
12904 : */
12905 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
12906 0 : if (__pyx_t_1) {
12907 :
12908 : /* "View.MemoryView":779
12909 : *
12910 : * if isinstance(memview, _memoryviewslice):
12911 : * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
12912 : * memviewsliceobj.to_object_func,
12913 : * memviewsliceobj.to_dtype_func,
12914 : */
12915 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
12916 :
12917 : /* "View.MemoryView":780
12918 : * if isinstance(memview, _memoryviewslice):
12919 : * return memoryview_fromslice(dst, new_ndim,
12920 : * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
12921 : * memviewsliceobj.to_dtype_func,
12922 : * memview.dtype_is_object)
12923 : */
12924 0 : if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
12925 :
12926 : /* "View.MemoryView":781
12927 : * return memoryview_fromslice(dst, new_ndim,
12928 : * memviewsliceobj.to_object_func,
12929 : * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
12930 : * memview.dtype_is_object)
12931 : * else:
12932 : */
12933 0 : if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
12934 :
12935 : /* "View.MemoryView":779
12936 : *
12937 : * if isinstance(memview, _memoryviewslice):
12938 : * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
12939 : * memviewsliceobj.to_object_func,
12940 : * memviewsliceobj.to_dtype_func,
12941 : */
12942 0 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 779, __pyx_L1_error)
12943 0 : __Pyx_GOTREF(__pyx_t_2);
12944 0 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
12945 0 : __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
12946 0 : __pyx_t_2 = 0;
12947 0 : goto __pyx_L0;
12948 :
12949 : /* "View.MemoryView":778
12950 : * new_ndim += 1
12951 : *
12952 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12953 : * return memoryview_fromslice(dst, new_ndim,
12954 : * memviewsliceobj.to_object_func,
12955 : */
12956 : }
12957 :
12958 : /* "View.MemoryView":784
12959 : * memview.dtype_is_object)
12960 : * else:
12961 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
12962 : * memview.dtype_is_object)
12963 : *
12964 : */
12965 : /*else*/ {
12966 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
12967 :
12968 : /* "View.MemoryView":785
12969 : * else:
12970 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
12971 : * memview.dtype_is_object) # <<<<<<<<<<<<<<
12972 : *
12973 : *
12974 : */
12975 0 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
12976 0 : __Pyx_GOTREF(__pyx_t_2);
12977 :
12978 : /* "View.MemoryView":784
12979 : * memview.dtype_is_object)
12980 : * else:
12981 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
12982 : * memview.dtype_is_object)
12983 : *
12984 : */
12985 0 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
12986 0 : __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
12987 0 : __pyx_t_2 = 0;
12988 0 : goto __pyx_L0;
12989 : }
12990 :
12991 : /* "View.MemoryView":711
12992 : *
12993 : * @cname('__pyx_memview_slice')
12994 : * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
12995 : * cdef int new_ndim = 0, suboffset_dim = -1, dim
12996 : * cdef bint negative_step
12997 : */
12998 :
12999 : /* function exit code */
13000 0 : __pyx_L1_error:;
13001 0 : __Pyx_XDECREF(__pyx_t_2);
13002 0 : __Pyx_XDECREF(__pyx_t_8);
13003 0 : __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13004 0 : __pyx_r = 0;
13005 0 : __pyx_L0:;
13006 0 : __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
13007 0 : __Pyx_XDECREF(__pyx_v_index);
13008 0 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
13009 0 : __Pyx_RefNannyFinishContext();
13010 0 : return __pyx_r;
13011 : }
13012 :
13013 : /* "View.MemoryView":793
13014 : *
13015 : * @cname('__pyx_memoryview_slice_memviewslice')
13016 : * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
13017 : * __Pyx_memviewslice *dst,
13018 : * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
13019 : */
13020 :
13021 0 : static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
13022 0 : Py_ssize_t __pyx_v_new_shape;
13023 0 : int __pyx_v_negative_step;
13024 0 : int __pyx_r;
13025 0 : int __pyx_t_1;
13026 0 : int __pyx_t_2;
13027 0 : int __pyx_t_3;
13028 0 : int __pyx_lineno = 0;
13029 0 : const char *__pyx_filename = NULL;
13030 0 : int __pyx_clineno = 0;
13031 : #ifdef WITH_THREAD
13032 0 : PyGILState_STATE __pyx_gilstate_save;
13033 : #endif
13034 :
13035 : /* "View.MemoryView":813
13036 : * cdef bint negative_step
13037 : *
13038 : * if not is_slice: # <<<<<<<<<<<<<<
13039 : *
13040 : * if start < 0:
13041 : */
13042 0 : __pyx_t_1 = (!__pyx_v_is_slice);
13043 0 : if (__pyx_t_1) {
13044 :
13045 : /* "View.MemoryView":815
13046 : * if not is_slice:
13047 : *
13048 : * if start < 0: # <<<<<<<<<<<<<<
13049 : * start += shape
13050 : * if not 0 <= start < shape:
13051 : */
13052 0 : __pyx_t_1 = (__pyx_v_start < 0);
13053 0 : if (__pyx_t_1) {
13054 :
13055 : /* "View.MemoryView":816
13056 : *
13057 : * if start < 0:
13058 : * start += shape # <<<<<<<<<<<<<<
13059 : * if not 0 <= start < shape:
13060 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13061 : */
13062 0 : __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
13063 :
13064 : /* "View.MemoryView":815
13065 : * if not is_slice:
13066 : *
13067 : * if start < 0: # <<<<<<<<<<<<<<
13068 : * start += shape
13069 : * if not 0 <= start < shape:
13070 : */
13071 : }
13072 :
13073 : /* "View.MemoryView":817
13074 : * if start < 0:
13075 : * start += shape
13076 : * if not 0 <= start < shape: # <<<<<<<<<<<<<<
13077 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13078 : * else:
13079 : */
13080 0 : __pyx_t_1 = (0 <= __pyx_v_start);
13081 0 : if (__pyx_t_1) {
13082 0 : __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
13083 : }
13084 0 : __pyx_t_2 = (!__pyx_t_1);
13085 0 : if (__pyx_t_2) {
13086 :
13087 : /* "View.MemoryView":818
13088 : * start += shape
13089 : * if not 0 <= start < shape:
13090 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
13091 : * else:
13092 : *
13093 : */
13094 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 818, __pyx_L1_error)
13095 :
13096 : /* "View.MemoryView":817
13097 : * if start < 0:
13098 : * start += shape
13099 : * if not 0 <= start < shape: # <<<<<<<<<<<<<<
13100 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13101 : * else:
13102 : */
13103 : }
13104 :
13105 : /* "View.MemoryView":813
13106 : * cdef bint negative_step
13107 : *
13108 : * if not is_slice: # <<<<<<<<<<<<<<
13109 : *
13110 : * if start < 0:
13111 : */
13112 0 : goto __pyx_L3;
13113 : }
13114 :
13115 : /* "View.MemoryView":821
13116 : * else:
13117 : *
13118 : * if have_step: # <<<<<<<<<<<<<<
13119 : * negative_step = step < 0
13120 : * if step == 0:
13121 : */
13122 : /*else*/ {
13123 0 : __pyx_t_2 = (__pyx_v_have_step != 0);
13124 0 : if (__pyx_t_2) {
13125 :
13126 : /* "View.MemoryView":822
13127 : *
13128 : * if have_step:
13129 : * negative_step = step < 0 # <<<<<<<<<<<<<<
13130 : * if step == 0:
13131 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13132 : */
13133 0 : __pyx_v_negative_step = (__pyx_v_step < 0);
13134 :
13135 : /* "View.MemoryView":823
13136 : * if have_step:
13137 : * negative_step = step < 0
13138 : * if step == 0: # <<<<<<<<<<<<<<
13139 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13140 : * else:
13141 : */
13142 0 : __pyx_t_2 = (__pyx_v_step == 0);
13143 0 : if (__pyx_t_2) {
13144 :
13145 : /* "View.MemoryView":824
13146 : * negative_step = step < 0
13147 : * if step == 0:
13148 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
13149 : * else:
13150 : * negative_step = False
13151 : */
13152 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 824, __pyx_L1_error)
13153 :
13154 : /* "View.MemoryView":823
13155 : * if have_step:
13156 : * negative_step = step < 0
13157 : * if step == 0: # <<<<<<<<<<<<<<
13158 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13159 : * else:
13160 : */
13161 : }
13162 :
13163 : /* "View.MemoryView":821
13164 : * else:
13165 : *
13166 : * if have_step: # <<<<<<<<<<<<<<
13167 : * negative_step = step < 0
13168 : * if step == 0:
13169 : */
13170 0 : goto __pyx_L6;
13171 : }
13172 :
13173 : /* "View.MemoryView":826
13174 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13175 : * else:
13176 : * negative_step = False # <<<<<<<<<<<<<<
13177 : * step = 1
13178 : *
13179 : */
13180 : /*else*/ {
13181 : __pyx_v_negative_step = 0;
13182 :
13183 : /* "View.MemoryView":827
13184 : * else:
13185 : * negative_step = False
13186 : * step = 1 # <<<<<<<<<<<<<<
13187 : *
13188 : *
13189 : */
13190 : __pyx_v_step = 1;
13191 : }
13192 0 : __pyx_L6:;
13193 :
13194 : /* "View.MemoryView":830
13195 : *
13196 : *
13197 : * if have_start: # <<<<<<<<<<<<<<
13198 : * if start < 0:
13199 : * start += shape
13200 : */
13201 0 : __pyx_t_2 = (__pyx_v_have_start != 0);
13202 0 : if (__pyx_t_2) {
13203 :
13204 : /* "View.MemoryView":831
13205 : *
13206 : * if have_start:
13207 : * if start < 0: # <<<<<<<<<<<<<<
13208 : * start += shape
13209 : * if start < 0:
13210 : */
13211 0 : __pyx_t_2 = (__pyx_v_start < 0);
13212 0 : if (__pyx_t_2) {
13213 :
13214 : /* "View.MemoryView":832
13215 : * if have_start:
13216 : * if start < 0:
13217 : * start += shape # <<<<<<<<<<<<<<
13218 : * if start < 0:
13219 : * start = 0
13220 : */
13221 0 : __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
13222 :
13223 : /* "View.MemoryView":833
13224 : * if start < 0:
13225 : * start += shape
13226 : * if start < 0: # <<<<<<<<<<<<<<
13227 : * start = 0
13228 : * elif start >= shape:
13229 : */
13230 0 : __pyx_t_2 = (__pyx_v_start < 0);
13231 0 : if (__pyx_t_2) {
13232 :
13233 : /* "View.MemoryView":834
13234 : * start += shape
13235 : * if start < 0:
13236 : * start = 0 # <<<<<<<<<<<<<<
13237 : * elif start >= shape:
13238 : * if negative_step:
13239 : */
13240 : __pyx_v_start = 0;
13241 :
13242 : /* "View.MemoryView":833
13243 : * if start < 0:
13244 : * start += shape
13245 : * if start < 0: # <<<<<<<<<<<<<<
13246 : * start = 0
13247 : * elif start >= shape:
13248 : */
13249 : }
13250 :
13251 : /* "View.MemoryView":831
13252 : *
13253 : * if have_start:
13254 : * if start < 0: # <<<<<<<<<<<<<<
13255 : * start += shape
13256 : * if start < 0:
13257 : */
13258 0 : goto __pyx_L9;
13259 : }
13260 :
13261 : /* "View.MemoryView":835
13262 : * if start < 0:
13263 : * start = 0
13264 : * elif start >= shape: # <<<<<<<<<<<<<<
13265 : * if negative_step:
13266 : * start = shape - 1
13267 : */
13268 0 : __pyx_t_2 = (__pyx_v_start >= __pyx_v_shape);
13269 0 : if (__pyx_t_2) {
13270 :
13271 : /* "View.MemoryView":836
13272 : * start = 0
13273 : * elif start >= shape:
13274 : * if negative_step: # <<<<<<<<<<<<<<
13275 : * start = shape - 1
13276 : * else:
13277 : */
13278 0 : if (__pyx_v_negative_step) {
13279 :
13280 : /* "View.MemoryView":837
13281 : * elif start >= shape:
13282 : * if negative_step:
13283 : * start = shape - 1 # <<<<<<<<<<<<<<
13284 : * else:
13285 : * start = shape
13286 : */
13287 0 : __pyx_v_start = (__pyx_v_shape - 1);
13288 :
13289 : /* "View.MemoryView":836
13290 : * start = 0
13291 : * elif start >= shape:
13292 : * if negative_step: # <<<<<<<<<<<<<<
13293 : * start = shape - 1
13294 : * else:
13295 : */
13296 0 : goto __pyx_L11;
13297 : }
13298 :
13299 : /* "View.MemoryView":839
13300 : * start = shape - 1
13301 : * else:
13302 : * start = shape # <<<<<<<<<<<<<<
13303 : * else:
13304 : * if negative_step:
13305 : */
13306 : /*else*/ {
13307 : __pyx_v_start = __pyx_v_shape;
13308 : }
13309 0 : __pyx_L11:;
13310 :
13311 : /* "View.MemoryView":835
13312 : * if start < 0:
13313 : * start = 0
13314 : * elif start >= shape: # <<<<<<<<<<<<<<
13315 : * if negative_step:
13316 : * start = shape - 1
13317 : */
13318 : }
13319 0 : __pyx_L9:;
13320 :
13321 : /* "View.MemoryView":830
13322 : *
13323 : *
13324 : * if have_start: # <<<<<<<<<<<<<<
13325 : * if start < 0:
13326 : * start += shape
13327 : */
13328 0 : goto __pyx_L8;
13329 : }
13330 :
13331 : /* "View.MemoryView":841
13332 : * start = shape
13333 : * else:
13334 : * if negative_step: # <<<<<<<<<<<<<<
13335 : * start = shape - 1
13336 : * else:
13337 : */
13338 : /*else*/ {
13339 0 : if (__pyx_v_negative_step) {
13340 :
13341 : /* "View.MemoryView":842
13342 : * else:
13343 : * if negative_step:
13344 : * start = shape - 1 # <<<<<<<<<<<<<<
13345 : * else:
13346 : * start = 0
13347 : */
13348 0 : __pyx_v_start = (__pyx_v_shape - 1);
13349 :
13350 : /* "View.MemoryView":841
13351 : * start = shape
13352 : * else:
13353 : * if negative_step: # <<<<<<<<<<<<<<
13354 : * start = shape - 1
13355 : * else:
13356 : */
13357 0 : goto __pyx_L12;
13358 : }
13359 :
13360 : /* "View.MemoryView":844
13361 : * start = shape - 1
13362 : * else:
13363 : * start = 0 # <<<<<<<<<<<<<<
13364 : *
13365 : * if have_stop:
13366 : */
13367 : /*else*/ {
13368 : __pyx_v_start = 0;
13369 : }
13370 0 : __pyx_L12:;
13371 : }
13372 0 : __pyx_L8:;
13373 :
13374 : /* "View.MemoryView":846
13375 : * start = 0
13376 : *
13377 : * if have_stop: # <<<<<<<<<<<<<<
13378 : * if stop < 0:
13379 : * stop += shape
13380 : */
13381 0 : __pyx_t_2 = (__pyx_v_have_stop != 0);
13382 0 : if (__pyx_t_2) {
13383 :
13384 : /* "View.MemoryView":847
13385 : *
13386 : * if have_stop:
13387 : * if stop < 0: # <<<<<<<<<<<<<<
13388 : * stop += shape
13389 : * if stop < 0:
13390 : */
13391 0 : __pyx_t_2 = (__pyx_v_stop < 0);
13392 0 : if (__pyx_t_2) {
13393 :
13394 : /* "View.MemoryView":848
13395 : * if have_stop:
13396 : * if stop < 0:
13397 : * stop += shape # <<<<<<<<<<<<<<
13398 : * if stop < 0:
13399 : * stop = 0
13400 : */
13401 0 : __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
13402 :
13403 : /* "View.MemoryView":849
13404 : * if stop < 0:
13405 : * stop += shape
13406 : * if stop < 0: # <<<<<<<<<<<<<<
13407 : * stop = 0
13408 : * elif stop > shape:
13409 : */
13410 0 : __pyx_t_2 = (__pyx_v_stop < 0);
13411 0 : if (__pyx_t_2) {
13412 :
13413 : /* "View.MemoryView":850
13414 : * stop += shape
13415 : * if stop < 0:
13416 : * stop = 0 # <<<<<<<<<<<<<<
13417 : * elif stop > shape:
13418 : * stop = shape
13419 : */
13420 : __pyx_v_stop = 0;
13421 :
13422 : /* "View.MemoryView":849
13423 : * if stop < 0:
13424 : * stop += shape
13425 : * if stop < 0: # <<<<<<<<<<<<<<
13426 : * stop = 0
13427 : * elif stop > shape:
13428 : */
13429 : }
13430 :
13431 : /* "View.MemoryView":847
13432 : *
13433 : * if have_stop:
13434 : * if stop < 0: # <<<<<<<<<<<<<<
13435 : * stop += shape
13436 : * if stop < 0:
13437 : */
13438 0 : goto __pyx_L14;
13439 : }
13440 :
13441 : /* "View.MemoryView":851
13442 : * if stop < 0:
13443 : * stop = 0
13444 : * elif stop > shape: # <<<<<<<<<<<<<<
13445 : * stop = shape
13446 : * else:
13447 : */
13448 0 : __pyx_t_2 = (__pyx_v_stop > __pyx_v_shape);
13449 0 : if (__pyx_t_2) {
13450 :
13451 : /* "View.MemoryView":852
13452 : * stop = 0
13453 : * elif stop > shape:
13454 : * stop = shape # <<<<<<<<<<<<<<
13455 : * else:
13456 : * if negative_step:
13457 : */
13458 : __pyx_v_stop = __pyx_v_shape;
13459 :
13460 : /* "View.MemoryView":851
13461 : * if stop < 0:
13462 : * stop = 0
13463 : * elif stop > shape: # <<<<<<<<<<<<<<
13464 : * stop = shape
13465 : * else:
13466 : */
13467 : }
13468 0 : __pyx_L14:;
13469 :
13470 : /* "View.MemoryView":846
13471 : * start = 0
13472 : *
13473 : * if have_stop: # <<<<<<<<<<<<<<
13474 : * if stop < 0:
13475 : * stop += shape
13476 : */
13477 0 : goto __pyx_L13;
13478 : }
13479 :
13480 : /* "View.MemoryView":854
13481 : * stop = shape
13482 : * else:
13483 : * if negative_step: # <<<<<<<<<<<<<<
13484 : * stop = -1
13485 : * else:
13486 : */
13487 : /*else*/ {
13488 0 : if (__pyx_v_negative_step) {
13489 :
13490 : /* "View.MemoryView":855
13491 : * else:
13492 : * if negative_step:
13493 : * stop = -1 # <<<<<<<<<<<<<<
13494 : * else:
13495 : * stop = shape
13496 : */
13497 0 : __pyx_v_stop = -1L;
13498 :
13499 : /* "View.MemoryView":854
13500 : * stop = shape
13501 : * else:
13502 : * if negative_step: # <<<<<<<<<<<<<<
13503 : * stop = -1
13504 : * else:
13505 : */
13506 0 : goto __pyx_L16;
13507 : }
13508 :
13509 : /* "View.MemoryView":857
13510 : * stop = -1
13511 : * else:
13512 : * stop = shape # <<<<<<<<<<<<<<
13513 : *
13514 : *
13515 : */
13516 : /*else*/ {
13517 : __pyx_v_stop = __pyx_v_shape;
13518 : }
13519 0 : __pyx_L16:;
13520 : }
13521 0 : __pyx_L13:;
13522 :
13523 : /* "View.MemoryView":861
13524 : *
13525 : * with cython.cdivision(True):
13526 : * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
13527 : *
13528 : * if (stop - start) - step * new_shape:
13529 : */
13530 0 : __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
13531 :
13532 : /* "View.MemoryView":863
13533 : * new_shape = (stop - start) // step
13534 : *
13535 : * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
13536 : * new_shape += 1
13537 : *
13538 : */
13539 0 : __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
13540 0 : if (__pyx_t_2) {
13541 :
13542 : /* "View.MemoryView":864
13543 : *
13544 : * if (stop - start) - step * new_shape:
13545 : * new_shape += 1 # <<<<<<<<<<<<<<
13546 : *
13547 : * if new_shape < 0:
13548 : */
13549 0 : __pyx_v_new_shape = (__pyx_v_new_shape + 1);
13550 :
13551 : /* "View.MemoryView":863
13552 : * new_shape = (stop - start) // step
13553 : *
13554 : * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
13555 : * new_shape += 1
13556 : *
13557 : */
13558 : }
13559 :
13560 : /* "View.MemoryView":866
13561 : * new_shape += 1
13562 : *
13563 : * if new_shape < 0: # <<<<<<<<<<<<<<
13564 : * new_shape = 0
13565 : *
13566 : */
13567 0 : __pyx_t_2 = (__pyx_v_new_shape < 0);
13568 0 : if (__pyx_t_2) {
13569 :
13570 : /* "View.MemoryView":867
13571 : *
13572 : * if new_shape < 0:
13573 : * new_shape = 0 # <<<<<<<<<<<<<<
13574 : *
13575 : *
13576 : */
13577 : __pyx_v_new_shape = 0;
13578 :
13579 : /* "View.MemoryView":866
13580 : * new_shape += 1
13581 : *
13582 : * if new_shape < 0: # <<<<<<<<<<<<<<
13583 : * new_shape = 0
13584 : *
13585 : */
13586 : }
13587 :
13588 : /* "View.MemoryView":870
13589 : *
13590 : *
13591 : * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
13592 : * dst.shape[new_ndim] = new_shape
13593 : * dst.suboffsets[new_ndim] = suboffset
13594 : */
13595 0 : (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
13596 :
13597 : /* "View.MemoryView":871
13598 : *
13599 : * dst.strides[new_ndim] = stride * step
13600 : * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
13601 : * dst.suboffsets[new_ndim] = suboffset
13602 : *
13603 : */
13604 0 : (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
13605 :
13606 : /* "View.MemoryView":872
13607 : * dst.strides[new_ndim] = stride * step
13608 : * dst.shape[new_ndim] = new_shape
13609 : * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
13610 : *
13611 : *
13612 : */
13613 0 : (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
13614 : }
13615 0 : __pyx_L3:;
13616 :
13617 : /* "View.MemoryView":875
13618 : *
13619 : *
13620 : * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
13621 : * dst.data += start * stride
13622 : * else:
13623 : */
13624 0 : __pyx_t_2 = ((__pyx_v_suboffset_dim[0]) < 0);
13625 0 : if (__pyx_t_2) {
13626 :
13627 : /* "View.MemoryView":876
13628 : *
13629 : * if suboffset_dim[0] < 0:
13630 : * dst.data += start * stride # <<<<<<<<<<<<<<
13631 : * else:
13632 : * dst.suboffsets[suboffset_dim[0]] += start * stride
13633 : */
13634 0 : __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
13635 :
13636 : /* "View.MemoryView":875
13637 : *
13638 : *
13639 : * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
13640 : * dst.data += start * stride
13641 : * else:
13642 : */
13643 0 : goto __pyx_L19;
13644 : }
13645 :
13646 : /* "View.MemoryView":878
13647 : * dst.data += start * stride
13648 : * else:
13649 : * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
13650 : *
13651 : * if suboffset >= 0:
13652 : */
13653 : /*else*/ {
13654 0 : __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
13655 0 : (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
13656 : }
13657 0 : __pyx_L19:;
13658 :
13659 : /* "View.MemoryView":880
13660 : * dst.suboffsets[suboffset_dim[0]] += start * stride
13661 : *
13662 : * if suboffset >= 0: # <<<<<<<<<<<<<<
13663 : * if not is_slice:
13664 : * if new_ndim == 0:
13665 : */
13666 0 : __pyx_t_2 = (__pyx_v_suboffset >= 0);
13667 0 : if (__pyx_t_2) {
13668 :
13669 : /* "View.MemoryView":881
13670 : *
13671 : * if suboffset >= 0:
13672 : * if not is_slice: # <<<<<<<<<<<<<<
13673 : * if new_ndim == 0:
13674 : * dst.data = (<char **> dst.data)[0] + suboffset
13675 : */
13676 0 : __pyx_t_2 = (!__pyx_v_is_slice);
13677 0 : if (__pyx_t_2) {
13678 :
13679 : /* "View.MemoryView":882
13680 : * if suboffset >= 0:
13681 : * if not is_slice:
13682 : * if new_ndim == 0: # <<<<<<<<<<<<<<
13683 : * dst.data = (<char **> dst.data)[0] + suboffset
13684 : * else:
13685 : */
13686 0 : __pyx_t_2 = (__pyx_v_new_ndim == 0);
13687 0 : if (__pyx_t_2) {
13688 :
13689 : /* "View.MemoryView":883
13690 : * if not is_slice:
13691 : * if new_ndim == 0:
13692 : * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
13693 : * else:
13694 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
13695 : */
13696 0 : __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
13697 :
13698 : /* "View.MemoryView":882
13699 : * if suboffset >= 0:
13700 : * if not is_slice:
13701 : * if new_ndim == 0: # <<<<<<<<<<<<<<
13702 : * dst.data = (<char **> dst.data)[0] + suboffset
13703 : * else:
13704 : */
13705 0 : goto __pyx_L22;
13706 : }
13707 :
13708 : /* "View.MemoryView":885
13709 : * dst.data = (<char **> dst.data)[0] + suboffset
13710 : * else:
13711 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
13712 : * "must be indexed and not sliced", dim)
13713 : * else:
13714 : */
13715 : /*else*/ {
13716 :
13717 : /* "View.MemoryView":886
13718 : * else:
13719 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
13720 : * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
13721 : * else:
13722 : * suboffset_dim[0] = new_ndim
13723 : */
13724 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 885, __pyx_L1_error)
13725 : }
13726 0 : __pyx_L22:;
13727 :
13728 : /* "View.MemoryView":881
13729 : *
13730 : * if suboffset >= 0:
13731 : * if not is_slice: # <<<<<<<<<<<<<<
13732 : * if new_ndim == 0:
13733 : * dst.data = (<char **> dst.data)[0] + suboffset
13734 : */
13735 0 : goto __pyx_L21;
13736 : }
13737 :
13738 : /* "View.MemoryView":888
13739 : * "must be indexed and not sliced", dim)
13740 : * else:
13741 : * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
13742 : *
13743 : * return 0
13744 : */
13745 : /*else*/ {
13746 0 : (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
13747 : }
13748 0 : __pyx_L21:;
13749 :
13750 : /* "View.MemoryView":880
13751 : * dst.suboffsets[suboffset_dim[0]] += start * stride
13752 : *
13753 : * if suboffset >= 0: # <<<<<<<<<<<<<<
13754 : * if not is_slice:
13755 : * if new_ndim == 0:
13756 : */
13757 : }
13758 :
13759 : /* "View.MemoryView":890
13760 : * suboffset_dim[0] = new_ndim
13761 : *
13762 : * return 0 # <<<<<<<<<<<<<<
13763 : *
13764 : *
13765 : */
13766 0 : __pyx_r = 0;
13767 0 : goto __pyx_L0;
13768 :
13769 : /* "View.MemoryView":793
13770 : *
13771 : * @cname('__pyx_memoryview_slice_memviewslice')
13772 : * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
13773 : * __Pyx_memviewslice *dst,
13774 : * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
13775 : */
13776 :
13777 : /* function exit code */
13778 0 : __pyx_L1_error:;
13779 : #ifdef WITH_THREAD
13780 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
13781 : #endif
13782 0 : __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13783 0 : __pyx_r = -1;
13784 : #ifdef WITH_THREAD
13785 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
13786 : #endif
13787 0 : __pyx_L0:;
13788 0 : return __pyx_r;
13789 : }
13790 :
13791 : /* "View.MemoryView":896
13792 : *
13793 : * @cname('__pyx_pybuffer_index')
13794 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
13795 : * Py_ssize_t dim) except NULL:
13796 : * cdef Py_ssize_t shape, stride, suboffset = -1
13797 : */
13798 :
13799 0 : static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
13800 0 : Py_ssize_t __pyx_v_shape;
13801 0 : Py_ssize_t __pyx_v_stride;
13802 0 : Py_ssize_t __pyx_v_suboffset;
13803 0 : Py_ssize_t __pyx_v_itemsize;
13804 0 : char *__pyx_v_resultp;
13805 0 : char *__pyx_r;
13806 : __Pyx_RefNannyDeclarations
13807 0 : Py_ssize_t __pyx_t_1;
13808 0 : int __pyx_t_2;
13809 0 : PyObject *__pyx_t_3 = NULL;
13810 0 : Py_UCS4 __pyx_t_4;
13811 0 : PyObject *__pyx_t_5 = NULL;
13812 0 : int __pyx_lineno = 0;
13813 0 : const char *__pyx_filename = NULL;
13814 0 : int __pyx_clineno = 0;
13815 0 : __Pyx_RefNannySetupContext("pybuffer_index", 1);
13816 :
13817 : /* "View.MemoryView":898
13818 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
13819 : * Py_ssize_t dim) except NULL:
13820 : * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
13821 : * cdef Py_ssize_t itemsize = view.itemsize
13822 : * cdef char *resultp
13823 : */
13824 0 : __pyx_v_suboffset = -1L;
13825 :
13826 : /* "View.MemoryView":899
13827 : * Py_ssize_t dim) except NULL:
13828 : * cdef Py_ssize_t shape, stride, suboffset = -1
13829 : * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
13830 : * cdef char *resultp
13831 : *
13832 : */
13833 0 : __pyx_t_1 = __pyx_v_view->itemsize;
13834 0 : __pyx_v_itemsize = __pyx_t_1;
13835 :
13836 : /* "View.MemoryView":902
13837 : * cdef char *resultp
13838 : *
13839 : * if view.ndim == 0: # <<<<<<<<<<<<<<
13840 : * shape = view.len // itemsize
13841 : * stride = itemsize
13842 : */
13843 0 : __pyx_t_2 = (__pyx_v_view->ndim == 0);
13844 0 : if (__pyx_t_2) {
13845 :
13846 : /* "View.MemoryView":903
13847 : *
13848 : * if view.ndim == 0:
13849 : * shape = view.len // itemsize # <<<<<<<<<<<<<<
13850 : * stride = itemsize
13851 : * else:
13852 : */
13853 0 : if (unlikely(__pyx_v_itemsize == 0)) {
13854 0 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
13855 0 : __PYX_ERR(1, 903, __pyx_L1_error)
13856 : }
13857 0 : else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
13858 0 : PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
13859 0 : __PYX_ERR(1, 903, __pyx_L1_error)
13860 : }
13861 0 : __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
13862 :
13863 : /* "View.MemoryView":904
13864 : * if view.ndim == 0:
13865 : * shape = view.len // itemsize
13866 : * stride = itemsize # <<<<<<<<<<<<<<
13867 : * else:
13868 : * shape = view.shape[dim]
13869 : */
13870 0 : __pyx_v_stride = __pyx_v_itemsize;
13871 :
13872 : /* "View.MemoryView":902
13873 : * cdef char *resultp
13874 : *
13875 : * if view.ndim == 0: # <<<<<<<<<<<<<<
13876 : * shape = view.len // itemsize
13877 : * stride = itemsize
13878 : */
13879 0 : goto __pyx_L3;
13880 : }
13881 :
13882 : /* "View.MemoryView":906
13883 : * stride = itemsize
13884 : * else:
13885 : * shape = view.shape[dim] # <<<<<<<<<<<<<<
13886 : * stride = view.strides[dim]
13887 : * if view.suboffsets != NULL:
13888 : */
13889 : /*else*/ {
13890 0 : __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
13891 :
13892 : /* "View.MemoryView":907
13893 : * else:
13894 : * shape = view.shape[dim]
13895 : * stride = view.strides[dim] # <<<<<<<<<<<<<<
13896 : * if view.suboffsets != NULL:
13897 : * suboffset = view.suboffsets[dim]
13898 : */
13899 0 : __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
13900 :
13901 : /* "View.MemoryView":908
13902 : * shape = view.shape[dim]
13903 : * stride = view.strides[dim]
13904 : * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
13905 : * suboffset = view.suboffsets[dim]
13906 : *
13907 : */
13908 0 : __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
13909 0 : if (__pyx_t_2) {
13910 :
13911 : /* "View.MemoryView":909
13912 : * stride = view.strides[dim]
13913 : * if view.suboffsets != NULL:
13914 : * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
13915 : *
13916 : * if index < 0:
13917 : */
13918 0 : __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
13919 :
13920 : /* "View.MemoryView":908
13921 : * shape = view.shape[dim]
13922 : * stride = view.strides[dim]
13923 : * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
13924 : * suboffset = view.suboffsets[dim]
13925 : *
13926 : */
13927 : }
13928 : }
13929 0 : __pyx_L3:;
13930 :
13931 : /* "View.MemoryView":911
13932 : * suboffset = view.suboffsets[dim]
13933 : *
13934 : * if index < 0: # <<<<<<<<<<<<<<
13935 : * index += view.shape[dim]
13936 : * if index < 0:
13937 : */
13938 0 : __pyx_t_2 = (__pyx_v_index < 0);
13939 0 : if (__pyx_t_2) {
13940 :
13941 : /* "View.MemoryView":912
13942 : *
13943 : * if index < 0:
13944 : * index += view.shape[dim] # <<<<<<<<<<<<<<
13945 : * if index < 0:
13946 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
13947 : */
13948 0 : __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
13949 :
13950 : /* "View.MemoryView":913
13951 : * if index < 0:
13952 : * index += view.shape[dim]
13953 : * if index < 0: # <<<<<<<<<<<<<<
13954 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
13955 : *
13956 : */
13957 0 : __pyx_t_2 = (__pyx_v_index < 0);
13958 0 : if (unlikely(__pyx_t_2)) {
13959 :
13960 : /* "View.MemoryView":914
13961 : * index += view.shape[dim]
13962 : * if index < 0:
13963 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
13964 : *
13965 : * if index >= shape:
13966 : */
13967 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
13968 0 : __Pyx_GOTREF(__pyx_t_3);
13969 0 : __pyx_t_1 = 0;
13970 0 : __pyx_t_4 = 127;
13971 0 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
13972 0 : __pyx_t_1 += 37;
13973 0 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
13974 0 : PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
13975 0 : __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
13976 0 : __Pyx_GOTREF(__pyx_t_5);
13977 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
13978 0 : __Pyx_GIVEREF(__pyx_t_5);
13979 0 : PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
13980 0 : __pyx_t_5 = 0;
13981 0 : __Pyx_INCREF(__pyx_kp_u__7);
13982 0 : __pyx_t_1 += 1;
13983 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
13984 0 : PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__7);
13985 0 : __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
13986 0 : __Pyx_GOTREF(__pyx_t_5);
13987 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13988 0 : __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_5, 0, 0);
13989 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13990 0 : __PYX_ERR(1, 914, __pyx_L1_error)
13991 :
13992 : /* "View.MemoryView":913
13993 : * if index < 0:
13994 : * index += view.shape[dim]
13995 : * if index < 0: # <<<<<<<<<<<<<<
13996 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
13997 : *
13998 : */
13999 : }
14000 :
14001 : /* "View.MemoryView":911
14002 : * suboffset = view.suboffsets[dim]
14003 : *
14004 : * if index < 0: # <<<<<<<<<<<<<<
14005 : * index += view.shape[dim]
14006 : * if index < 0:
14007 : */
14008 : }
14009 :
14010 : /* "View.MemoryView":916
14011 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14012 : *
14013 : * if index >= shape: # <<<<<<<<<<<<<<
14014 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14015 : *
14016 : */
14017 0 : __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
14018 0 : if (unlikely(__pyx_t_2)) {
14019 :
14020 : /* "View.MemoryView":917
14021 : *
14022 : * if index >= shape:
14023 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
14024 : *
14025 : * resultp = bufp + index * stride
14026 : */
14027 0 : __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 917, __pyx_L1_error)
14028 0 : __Pyx_GOTREF(__pyx_t_5);
14029 0 : __pyx_t_1 = 0;
14030 0 : __pyx_t_4 = 127;
14031 0 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14032 0 : __pyx_t_1 += 37;
14033 0 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14034 0 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14035 0 : __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
14036 0 : __Pyx_GOTREF(__pyx_t_3);
14037 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
14038 0 : __Pyx_GIVEREF(__pyx_t_3);
14039 0 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
14040 0 : __pyx_t_3 = 0;
14041 0 : __Pyx_INCREF(__pyx_kp_u__7);
14042 0 : __pyx_t_1 += 1;
14043 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
14044 0 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__7);
14045 0 : __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
14046 0 : __Pyx_GOTREF(__pyx_t_3);
14047 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14048 0 : __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_3, 0, 0);
14049 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14050 0 : __PYX_ERR(1, 917, __pyx_L1_error)
14051 :
14052 : /* "View.MemoryView":916
14053 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14054 : *
14055 : * if index >= shape: # <<<<<<<<<<<<<<
14056 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14057 : *
14058 : */
14059 : }
14060 :
14061 : /* "View.MemoryView":919
14062 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14063 : *
14064 : * resultp = bufp + index * stride # <<<<<<<<<<<<<<
14065 : * if suboffset >= 0:
14066 : * resultp = (<char **> resultp)[0] + suboffset
14067 : */
14068 0 : __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14069 :
14070 : /* "View.MemoryView":920
14071 : *
14072 : * resultp = bufp + index * stride
14073 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14074 : * resultp = (<char **> resultp)[0] + suboffset
14075 : *
14076 : */
14077 0 : __pyx_t_2 = (__pyx_v_suboffset >= 0);
14078 0 : if (__pyx_t_2) {
14079 :
14080 : /* "View.MemoryView":921
14081 : * resultp = bufp + index * stride
14082 : * if suboffset >= 0:
14083 : * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
14084 : *
14085 : * return resultp
14086 : */
14087 0 : __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14088 :
14089 : /* "View.MemoryView":920
14090 : *
14091 : * resultp = bufp + index * stride
14092 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14093 : * resultp = (<char **> resultp)[0] + suboffset
14094 : *
14095 : */
14096 : }
14097 :
14098 : /* "View.MemoryView":923
14099 : * resultp = (<char **> resultp)[0] + suboffset
14100 : *
14101 : * return resultp # <<<<<<<<<<<<<<
14102 : *
14103 : *
14104 : */
14105 0 : __pyx_r = __pyx_v_resultp;
14106 0 : goto __pyx_L0;
14107 :
14108 : /* "View.MemoryView":896
14109 : *
14110 : * @cname('__pyx_pybuffer_index')
14111 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
14112 : * Py_ssize_t dim) except NULL:
14113 : * cdef Py_ssize_t shape, stride, suboffset = -1
14114 : */
14115 :
14116 : /* function exit code */
14117 0 : __pyx_L1_error:;
14118 0 : __Pyx_XDECREF(__pyx_t_3);
14119 0 : __Pyx_XDECREF(__pyx_t_5);
14120 0 : __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14121 0 : __pyx_r = NULL;
14122 0 : __pyx_L0:;
14123 0 : __Pyx_RefNannyFinishContext();
14124 0 : return __pyx_r;
14125 : }
14126 :
14127 : /* "View.MemoryView":929
14128 : *
14129 : * @cname('__pyx_memslice_transpose')
14130 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
14131 : * cdef int ndim = memslice.memview.view.ndim
14132 : *
14133 : */
14134 :
14135 0 : static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14136 0 : int __pyx_v_ndim;
14137 0 : Py_ssize_t *__pyx_v_shape;
14138 0 : Py_ssize_t *__pyx_v_strides;
14139 0 : int __pyx_v_i;
14140 0 : int __pyx_v_j;
14141 0 : int __pyx_r;
14142 0 : int __pyx_t_1;
14143 0 : Py_ssize_t *__pyx_t_2;
14144 0 : long __pyx_t_3;
14145 0 : long __pyx_t_4;
14146 0 : Py_ssize_t __pyx_t_5;
14147 0 : Py_ssize_t __pyx_t_6;
14148 0 : int __pyx_t_7;
14149 0 : int __pyx_t_8;
14150 0 : int __pyx_t_9;
14151 0 : int __pyx_lineno = 0;
14152 0 : const char *__pyx_filename = NULL;
14153 0 : int __pyx_clineno = 0;
14154 : #ifdef WITH_THREAD
14155 0 : PyGILState_STATE __pyx_gilstate_save;
14156 : #endif
14157 :
14158 : /* "View.MemoryView":930
14159 : * @cname('__pyx_memslice_transpose')
14160 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14161 : * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
14162 : *
14163 : * cdef Py_ssize_t *shape = memslice.shape
14164 : */
14165 0 : __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14166 0 : __pyx_v_ndim = __pyx_t_1;
14167 :
14168 : /* "View.MemoryView":932
14169 : * cdef int ndim = memslice.memview.view.ndim
14170 : *
14171 : * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
14172 : * cdef Py_ssize_t *strides = memslice.strides
14173 : *
14174 : */
14175 0 : __pyx_t_2 = __pyx_v_memslice->shape;
14176 0 : __pyx_v_shape = __pyx_t_2;
14177 :
14178 : /* "View.MemoryView":933
14179 : *
14180 : * cdef Py_ssize_t *shape = memslice.shape
14181 : * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
14182 : *
14183 : *
14184 : */
14185 0 : __pyx_t_2 = __pyx_v_memslice->strides;
14186 0 : __pyx_v_strides = __pyx_t_2;
14187 :
14188 : /* "View.MemoryView":937
14189 : *
14190 : * cdef int i, j
14191 : * for i in range(ndim // 2): # <<<<<<<<<<<<<<
14192 : * j = ndim - 1 - i
14193 : * strides[i], strides[j] = strides[j], strides[i]
14194 : */
14195 0 : __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
14196 0 : __pyx_t_4 = __pyx_t_3;
14197 0 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14198 0 : __pyx_v_i = __pyx_t_1;
14199 :
14200 : /* "View.MemoryView":938
14201 : * cdef int i, j
14202 : * for i in range(ndim // 2):
14203 : * j = ndim - 1 - i # <<<<<<<<<<<<<<
14204 : * strides[i], strides[j] = strides[j], strides[i]
14205 : * shape[i], shape[j] = shape[j], shape[i]
14206 : */
14207 0 : __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14208 :
14209 : /* "View.MemoryView":939
14210 : * for i in range(ndim // 2):
14211 : * j = ndim - 1 - i
14212 : * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
14213 : * shape[i], shape[j] = shape[j], shape[i]
14214 : *
14215 : */
14216 0 : __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14217 0 : __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14218 0 : (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14219 0 : (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14220 :
14221 : /* "View.MemoryView":940
14222 : * j = ndim - 1 - i
14223 : * strides[i], strides[j] = strides[j], strides[i]
14224 : * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
14225 : *
14226 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
14227 : */
14228 0 : __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14229 0 : __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14230 0 : (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14231 0 : (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14232 :
14233 : /* "View.MemoryView":942
14234 : * shape[i], shape[j] = shape[j], shape[i]
14235 : *
14236 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
14237 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14238 : *
14239 : */
14240 0 : __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
14241 0 : if (!__pyx_t_8) {
14242 0 : } else {
14243 0 : __pyx_t_7 = __pyx_t_8;
14244 0 : goto __pyx_L6_bool_binop_done;
14245 : }
14246 0 : __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
14247 0 : __pyx_t_7 = __pyx_t_8;
14248 0 : __pyx_L6_bool_binop_done:;
14249 0 : if (__pyx_t_7) {
14250 :
14251 : /* "View.MemoryView":943
14252 : *
14253 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
14254 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
14255 : *
14256 : * return 0
14257 : */
14258 0 : __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_kp_s_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L1_error)
14259 :
14260 : /* "View.MemoryView":942
14261 : * shape[i], shape[j] = shape[j], shape[i]
14262 : *
14263 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
14264 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14265 : *
14266 : */
14267 : }
14268 : }
14269 :
14270 : /* "View.MemoryView":945
14271 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14272 : *
14273 : * return 0 # <<<<<<<<<<<<<<
14274 : *
14275 : *
14276 : */
14277 0 : __pyx_r = 0;
14278 0 : goto __pyx_L0;
14279 :
14280 : /* "View.MemoryView":929
14281 : *
14282 : * @cname('__pyx_memslice_transpose')
14283 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
14284 : * cdef int ndim = memslice.memview.view.ndim
14285 : *
14286 : */
14287 :
14288 : /* function exit code */
14289 0 : __pyx_L1_error:;
14290 : #ifdef WITH_THREAD
14291 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14292 : #endif
14293 0 : __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14294 0 : __pyx_r = -1;
14295 : #ifdef WITH_THREAD
14296 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
14297 : #endif
14298 0 : __pyx_L0:;
14299 0 : return __pyx_r;
14300 : }
14301 :
14302 : /* "View.MemoryView":963
14303 : * cdef int (*to_dtype_func)(char *, object) except 0
14304 : *
14305 : * def __dealloc__(self): # <<<<<<<<<<<<<<
14306 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14307 : *
14308 : */
14309 :
14310 : /* Python wrapper */
14311 : static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
14312 338 : static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
14313 338 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14314 : __Pyx_RefNannyDeclarations
14315 338 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
14316 338 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
14317 676 : __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14318 :
14319 : /* function exit code */
14320 338 : __Pyx_RefNannyFinishContext();
14321 : }
14322 :
14323 338 : static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14324 :
14325 : /* "View.MemoryView":964
14326 : *
14327 : * def __dealloc__(self):
14328 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
14329 : *
14330 : * cdef convert_item_to_object(self, char *itemp):
14331 : */
14332 338 : __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
14333 :
14334 : /* "View.MemoryView":963
14335 : * cdef int (*to_dtype_func)(char *, object) except 0
14336 : *
14337 : * def __dealloc__(self): # <<<<<<<<<<<<<<
14338 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14339 : *
14340 : */
14341 :
14342 : /* function exit code */
14343 : }
14344 :
14345 : /* "View.MemoryView":966
14346 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14347 : *
14348 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14349 : * if self.to_object_func != NULL:
14350 : * return self.to_object_func(itemp)
14351 : */
14352 :
14353 0 : static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
14354 0 : PyObject *__pyx_r = NULL;
14355 : __Pyx_RefNannyDeclarations
14356 0 : int __pyx_t_1;
14357 0 : PyObject *__pyx_t_2 = NULL;
14358 0 : int __pyx_lineno = 0;
14359 0 : const char *__pyx_filename = NULL;
14360 0 : int __pyx_clineno = 0;
14361 0 : __Pyx_RefNannySetupContext("convert_item_to_object", 1);
14362 :
14363 : /* "View.MemoryView":967
14364 : *
14365 : * cdef convert_item_to_object(self, char *itemp):
14366 : * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14367 : * return self.to_object_func(itemp)
14368 : * else:
14369 : */
14370 0 : __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
14371 0 : if (__pyx_t_1) {
14372 :
14373 : /* "View.MemoryView":968
14374 : * cdef convert_item_to_object(self, char *itemp):
14375 : * if self.to_object_func != NULL:
14376 : * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
14377 : * else:
14378 : * return memoryview.convert_item_to_object(self, itemp)
14379 : */
14380 0 : __Pyx_XDECREF(__pyx_r);
14381 0 : __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 968, __pyx_L1_error)
14382 0 : __Pyx_GOTREF(__pyx_t_2);
14383 0 : __pyx_r = __pyx_t_2;
14384 0 : __pyx_t_2 = 0;
14385 0 : goto __pyx_L0;
14386 :
14387 : /* "View.MemoryView":967
14388 : *
14389 : * cdef convert_item_to_object(self, char *itemp):
14390 : * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14391 : * return self.to_object_func(itemp)
14392 : * else:
14393 : */
14394 : }
14395 :
14396 : /* "View.MemoryView":970
14397 : * return self.to_object_func(itemp)
14398 : * else:
14399 : * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
14400 : *
14401 : * cdef assign_item_from_object(self, char *itemp, object value):
14402 : */
14403 : /*else*/ {
14404 0 : __Pyx_XDECREF(__pyx_r);
14405 0 : __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 970, __pyx_L1_error)
14406 0 : __Pyx_GOTREF(__pyx_t_2);
14407 0 : __pyx_r = __pyx_t_2;
14408 0 : __pyx_t_2 = 0;
14409 0 : goto __pyx_L0;
14410 : }
14411 :
14412 : /* "View.MemoryView":966
14413 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14414 : *
14415 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14416 : * if self.to_object_func != NULL:
14417 : * return self.to_object_func(itemp)
14418 : */
14419 :
14420 : /* function exit code */
14421 0 : __pyx_L1_error:;
14422 0 : __Pyx_XDECREF(__pyx_t_2);
14423 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14424 0 : __pyx_r = 0;
14425 0 : __pyx_L0:;
14426 0 : __Pyx_XGIVEREF(__pyx_r);
14427 0 : __Pyx_RefNannyFinishContext();
14428 0 : return __pyx_r;
14429 : }
14430 :
14431 : /* "View.MemoryView":972
14432 : * return memoryview.convert_item_to_object(self, itemp)
14433 : *
14434 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14435 : * if self.to_dtype_func != NULL:
14436 : * self.to_dtype_func(itemp, value)
14437 : */
14438 :
14439 0 : static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14440 0 : PyObject *__pyx_r = NULL;
14441 : __Pyx_RefNannyDeclarations
14442 0 : int __pyx_t_1;
14443 0 : int __pyx_t_2;
14444 0 : PyObject *__pyx_t_3 = NULL;
14445 0 : int __pyx_lineno = 0;
14446 0 : const char *__pyx_filename = NULL;
14447 0 : int __pyx_clineno = 0;
14448 0 : __Pyx_RefNannySetupContext("assign_item_from_object", 1);
14449 :
14450 : /* "View.MemoryView":973
14451 : *
14452 : * cdef assign_item_from_object(self, char *itemp, object value):
14453 : * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14454 : * self.to_dtype_func(itemp, value)
14455 : * else:
14456 : */
14457 0 : __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
14458 0 : if (__pyx_t_1) {
14459 :
14460 : /* "View.MemoryView":974
14461 : * cdef assign_item_from_object(self, char *itemp, object value):
14462 : * if self.to_dtype_func != NULL:
14463 : * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
14464 : * else:
14465 : * memoryview.assign_item_from_object(self, itemp, value)
14466 : */
14467 0 : __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 974, __pyx_L1_error)
14468 :
14469 : /* "View.MemoryView":973
14470 : *
14471 : * cdef assign_item_from_object(self, char *itemp, object value):
14472 : * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14473 : * self.to_dtype_func(itemp, value)
14474 : * else:
14475 : */
14476 0 : goto __pyx_L3;
14477 : }
14478 :
14479 : /* "View.MemoryView":976
14480 : * self.to_dtype_func(itemp, value)
14481 : * else:
14482 : * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
14483 : *
14484 : * cdef _get_base(self):
14485 : */
14486 : /*else*/ {
14487 0 : __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 976, __pyx_L1_error)
14488 0 : __Pyx_GOTREF(__pyx_t_3);
14489 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14490 : }
14491 0 : __pyx_L3:;
14492 :
14493 : /* "View.MemoryView":972
14494 : * return memoryview.convert_item_to_object(self, itemp)
14495 : *
14496 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14497 : * if self.to_dtype_func != NULL:
14498 : * self.to_dtype_func(itemp, value)
14499 : */
14500 :
14501 : /* function exit code */
14502 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14503 0 : goto __pyx_L0;
14504 0 : __pyx_L1_error:;
14505 0 : __Pyx_XDECREF(__pyx_t_3);
14506 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14507 0 : __pyx_r = 0;
14508 0 : __pyx_L0:;
14509 0 : __Pyx_XGIVEREF(__pyx_r);
14510 0 : __Pyx_RefNannyFinishContext();
14511 0 : return __pyx_r;
14512 : }
14513 :
14514 : /* "View.MemoryView":978
14515 : * memoryview.assign_item_from_object(self, itemp, value)
14516 : *
14517 : * cdef _get_base(self): # <<<<<<<<<<<<<<
14518 : * return self.from_object
14519 : *
14520 : */
14521 :
14522 0 : static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14523 0 : PyObject *__pyx_r = NULL;
14524 : __Pyx_RefNannyDeclarations
14525 0 : __Pyx_RefNannySetupContext("_get_base", 1);
14526 :
14527 : /* "View.MemoryView":979
14528 : *
14529 : * cdef _get_base(self):
14530 : * return self.from_object # <<<<<<<<<<<<<<
14531 : *
14532 : *
14533 : */
14534 0 : __Pyx_XDECREF(__pyx_r);
14535 0 : __Pyx_INCREF(__pyx_v_self->from_object);
14536 0 : __pyx_r = __pyx_v_self->from_object;
14537 0 : goto __pyx_L0;
14538 :
14539 : /* "View.MemoryView":978
14540 : * memoryview.assign_item_from_object(self, itemp, value)
14541 : *
14542 : * cdef _get_base(self): # <<<<<<<<<<<<<<
14543 : * return self.from_object
14544 : *
14545 : */
14546 :
14547 : /* function exit code */
14548 0 : __pyx_L0:;
14549 0 : __Pyx_XGIVEREF(__pyx_r);
14550 0 : __Pyx_RefNannyFinishContext();
14551 0 : return __pyx_r;
14552 : }
14553 :
14554 : /* "(tree fragment)":1
14555 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14556 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14557 : * def __setstate_cython__(self, __pyx_state):
14558 : */
14559 :
14560 : /* Python wrapper */
14561 : static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14562 : #if CYTHON_METH_FASTCALL
14563 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14564 : #else
14565 : PyObject *__pyx_args, PyObject *__pyx_kwds
14566 : #endif
14567 : ); /*proto*/
14568 0 : static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14569 : #if CYTHON_METH_FASTCALL
14570 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14571 : #else
14572 : PyObject *__pyx_args, PyObject *__pyx_kwds
14573 : #endif
14574 : ) {
14575 : #if !CYTHON_METH_FASTCALL
14576 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14577 : #endif
14578 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14579 0 : PyObject *__pyx_r = 0;
14580 : __Pyx_RefNannyDeclarations
14581 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14582 : #if !CYTHON_METH_FASTCALL
14583 : #if CYTHON_ASSUME_SAFE_MACROS
14584 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14585 : #else
14586 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14587 : #endif
14588 : #endif
14589 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14590 0 : if (unlikely(__pyx_nargs > 0)) {
14591 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
14592 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
14593 0 : __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14594 :
14595 : /* function exit code */
14596 0 : __Pyx_RefNannyFinishContext();
14597 0 : return __pyx_r;
14598 : }
14599 :
14600 0 : static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14601 0 : PyObject *__pyx_r = NULL;
14602 : __Pyx_RefNannyDeclarations
14603 0 : int __pyx_lineno = 0;
14604 0 : const char *__pyx_filename = NULL;
14605 0 : int __pyx_clineno = 0;
14606 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
14607 :
14608 : /* "(tree fragment)":2
14609 : * def __reduce_cython__(self):
14610 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
14611 : * def __setstate_cython__(self, __pyx_state):
14612 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14613 : */
14614 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
14615 0 : __PYX_ERR(1, 2, __pyx_L1_error)
14616 :
14617 : /* "(tree fragment)":1
14618 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14619 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14620 : * def __setstate_cython__(self, __pyx_state):
14621 : */
14622 :
14623 : /* function exit code */
14624 0 : __pyx_L1_error:;
14625 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14626 0 : __pyx_r = NULL;
14627 0 : __Pyx_XGIVEREF(__pyx_r);
14628 0 : __Pyx_RefNannyFinishContext();
14629 0 : return __pyx_r;
14630 : }
14631 :
14632 : /* "(tree fragment)":3
14633 : * def __reduce_cython__(self):
14634 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14635 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14636 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14637 : */
14638 :
14639 : /* Python wrapper */
14640 : static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
14641 : #if CYTHON_METH_FASTCALL
14642 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14643 : #else
14644 : PyObject *__pyx_args, PyObject *__pyx_kwds
14645 : #endif
14646 : ); /*proto*/
14647 0 : static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
14648 : #if CYTHON_METH_FASTCALL
14649 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14650 : #else
14651 : PyObject *__pyx_args, PyObject *__pyx_kwds
14652 : #endif
14653 : ) {
14654 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
14655 : #if !CYTHON_METH_FASTCALL
14656 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14657 : #endif
14658 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14659 0 : PyObject* values[1] = {0};
14660 0 : int __pyx_lineno = 0;
14661 0 : const char *__pyx_filename = NULL;
14662 0 : int __pyx_clineno = 0;
14663 0 : PyObject *__pyx_r = 0;
14664 : __Pyx_RefNannyDeclarations
14665 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14666 : #if !CYTHON_METH_FASTCALL
14667 : #if CYTHON_ASSUME_SAFE_MACROS
14668 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14669 : #else
14670 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14671 : #endif
14672 : #endif
14673 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14674 : {
14675 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
14676 0 : if (__pyx_kwds) {
14677 0 : Py_ssize_t kw_args;
14678 0 : switch (__pyx_nargs) {
14679 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
14680 0 : CYTHON_FALLTHROUGH;
14681 0 : case 0: break;
14682 0 : default: goto __pyx_L5_argtuple_error;
14683 : }
14684 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
14685 0 : switch (__pyx_nargs) {
14686 : case 0:
14687 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
14688 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
14689 0 : kw_args--;
14690 : }
14691 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
14692 0 : else goto __pyx_L5_argtuple_error;
14693 : }
14694 0 : if (unlikely(kw_args > 0)) {
14695 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
14696 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
14697 : }
14698 0 : } else if (unlikely(__pyx_nargs != 1)) {
14699 0 : goto __pyx_L5_argtuple_error;
14700 : } else {
14701 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
14702 : }
14703 0 : __pyx_v___pyx_state = values[0];
14704 : }
14705 0 : goto __pyx_L6_skip;
14706 0 : __pyx_L5_argtuple_error:;
14707 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
14708 0 : __pyx_L6_skip:;
14709 0 : goto __pyx_L4_argument_unpacking_done;
14710 0 : __pyx_L3_error:;
14711 : {
14712 0 : Py_ssize_t __pyx_temp;
14713 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14714 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
14715 : }
14716 : }
14717 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14718 0 : __Pyx_RefNannyFinishContext();
14719 0 : return NULL;
14720 0 : __pyx_L4_argument_unpacking_done:;
14721 0 : __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
14722 :
14723 : /* function exit code */
14724 : {
14725 0 : Py_ssize_t __pyx_temp;
14726 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14727 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
14728 : }
14729 : }
14730 : __Pyx_RefNannyFinishContext();
14731 : return __pyx_r;
14732 : }
14733 :
14734 0 : static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14735 0 : PyObject *__pyx_r = NULL;
14736 : __Pyx_RefNannyDeclarations
14737 0 : int __pyx_lineno = 0;
14738 0 : const char *__pyx_filename = NULL;
14739 0 : int __pyx_clineno = 0;
14740 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
14741 :
14742 : /* "(tree fragment)":4
14743 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14744 : * def __setstate_cython__(self, __pyx_state):
14745 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
14746 : */
14747 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
14748 0 : __PYX_ERR(1, 4, __pyx_L1_error)
14749 :
14750 : /* "(tree fragment)":3
14751 : * def __reduce_cython__(self):
14752 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14753 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14754 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14755 : */
14756 :
14757 : /* function exit code */
14758 0 : __pyx_L1_error:;
14759 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14760 0 : __pyx_r = NULL;
14761 0 : __Pyx_XGIVEREF(__pyx_r);
14762 0 : __Pyx_RefNannyFinishContext();
14763 0 : return __pyx_r;
14764 : }
14765 :
14766 : /* "View.MemoryView":999
14767 : *
14768 : * @cname('__pyx_memoryview_fromslice')
14769 : * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
14770 : * int ndim,
14771 : * object (*to_object_func)(char *),
14772 : */
14773 :
14774 338 : static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
14775 338 : struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
14776 338 : Py_ssize_t __pyx_v_suboffset;
14777 338 : PyObject *__pyx_v_length = NULL;
14778 338 : PyObject *__pyx_r = NULL;
14779 : __Pyx_RefNannyDeclarations
14780 338 : int __pyx_t_1;
14781 338 : PyObject *__pyx_t_2 = NULL;
14782 338 : PyObject *__pyx_t_3 = NULL;
14783 338 : __Pyx_TypeInfo *__pyx_t_4;
14784 338 : Py_buffer __pyx_t_5;
14785 338 : Py_ssize_t *__pyx_t_6;
14786 338 : Py_ssize_t *__pyx_t_7;
14787 338 : Py_ssize_t *__pyx_t_8;
14788 338 : Py_ssize_t __pyx_t_9;
14789 338 : int __pyx_lineno = 0;
14790 338 : const char *__pyx_filename = NULL;
14791 338 : int __pyx_clineno = 0;
14792 338 : __Pyx_RefNannySetupContext("memoryview_fromslice", 1);
14793 :
14794 : /* "View.MemoryView":1007
14795 : * cdef _memoryviewslice result
14796 : *
14797 : * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
14798 : * return None
14799 : *
14800 : */
14801 338 : __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
14802 338 : if (__pyx_t_1) {
14803 :
14804 : /* "View.MemoryView":1008
14805 : *
14806 : * if <PyObject *> memviewslice.memview == Py_None:
14807 : * return None # <<<<<<<<<<<<<<
14808 : *
14809 : *
14810 : */
14811 0 : __Pyx_XDECREF(__pyx_r);
14812 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14813 0 : goto __pyx_L0;
14814 :
14815 : /* "View.MemoryView":1007
14816 : * cdef _memoryviewslice result
14817 : *
14818 : * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
14819 : * return None
14820 : *
14821 : */
14822 : }
14823 :
14824 : /* "View.MemoryView":1013
14825 : *
14826 : *
14827 : * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<<
14828 : *
14829 : * result.from_slice = memviewslice
14830 : */
14831 338 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
14832 338 : __Pyx_GOTREF(__pyx_t_2);
14833 338 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
14834 338 : __Pyx_GOTREF(__pyx_t_3);
14835 338 : __Pyx_INCREF(Py_None);
14836 338 : __Pyx_GIVEREF(Py_None);
14837 338 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(1, 1013, __pyx_L1_error);
14838 338 : __Pyx_INCREF(__pyx_int_0);
14839 338 : __Pyx_GIVEREF(__pyx_int_0);
14840 338 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(1, 1013, __pyx_L1_error);
14841 338 : __Pyx_GIVEREF(__pyx_t_2);
14842 338 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error);
14843 338 : __pyx_t_2 = 0;
14844 338 : __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
14845 338 : __Pyx_GOTREF((PyObject *)__pyx_t_2);
14846 338 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14847 338 : __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
14848 338 : __pyx_t_2 = 0;
14849 :
14850 : /* "View.MemoryView":1015
14851 : * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
14852 : *
14853 : * result.from_slice = memviewslice # <<<<<<<<<<<<<<
14854 : * __PYX_INC_MEMVIEW(&memviewslice, 1)
14855 : *
14856 : */
14857 338 : __pyx_v_result->from_slice = __pyx_v_memviewslice;
14858 :
14859 : /* "View.MemoryView":1016
14860 : *
14861 : * result.from_slice = memviewslice
14862 : * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
14863 : *
14864 : * result.from_object = (<memoryview> memviewslice.memview)._get_base()
14865 : */
14866 338 : __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
14867 :
14868 : /* "View.MemoryView":1018
14869 : * __PYX_INC_MEMVIEW(&memviewslice, 1)
14870 : *
14871 : * result.from_object = (<memoryview> memviewslice.memview)._get_base() # <<<<<<<<<<<<<<
14872 : * result.typeinfo = memviewslice.memview.typeinfo
14873 : *
14874 : */
14875 338 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
14876 338 : __Pyx_GOTREF(__pyx_t_2);
14877 338 : __Pyx_GIVEREF(__pyx_t_2);
14878 338 : __Pyx_GOTREF(__pyx_v_result->from_object);
14879 338 : __Pyx_DECREF(__pyx_v_result->from_object);
14880 338 : __pyx_v_result->from_object = __pyx_t_2;
14881 338 : __pyx_t_2 = 0;
14882 :
14883 : /* "View.MemoryView":1019
14884 : *
14885 : * result.from_object = (<memoryview> memviewslice.memview)._get_base()
14886 : * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
14887 : *
14888 : * result.view = memviewslice.memview.view
14889 : */
14890 338 : __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
14891 338 : __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
14892 :
14893 : /* "View.MemoryView":1021
14894 : * result.typeinfo = memviewslice.memview.typeinfo
14895 : *
14896 : * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
14897 : * result.view.buf = <void *> memviewslice.data
14898 : * result.view.ndim = ndim
14899 : */
14900 338 : __pyx_t_5 = __pyx_v_memviewslice.memview->view;
14901 338 : __pyx_v_result->__pyx_base.view = __pyx_t_5;
14902 :
14903 : /* "View.MemoryView":1022
14904 : *
14905 : * result.view = memviewslice.memview.view
14906 : * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
14907 : * result.view.ndim = ndim
14908 : * (<__pyx_buffer *> &result.view).obj = Py_None
14909 : */
14910 338 : __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
14911 :
14912 : /* "View.MemoryView":1023
14913 : * result.view = memviewslice.memview.view
14914 : * result.view.buf = <void *> memviewslice.data
14915 : * result.view.ndim = ndim # <<<<<<<<<<<<<<
14916 : * (<__pyx_buffer *> &result.view).obj = Py_None
14917 : * Py_INCREF(Py_None)
14918 : */
14919 338 : __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
14920 :
14921 : /* "View.MemoryView":1024
14922 : * result.view.buf = <void *> memviewslice.data
14923 : * result.view.ndim = ndim
14924 : * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
14925 : * Py_INCREF(Py_None)
14926 : *
14927 : */
14928 338 : ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
14929 :
14930 : /* "View.MemoryView":1025
14931 : * result.view.ndim = ndim
14932 : * (<__pyx_buffer *> &result.view).obj = Py_None
14933 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
14934 : *
14935 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
14936 : */
14937 338 : Py_INCREF(Py_None);
14938 :
14939 : /* "View.MemoryView":1027
14940 : * Py_INCREF(Py_None)
14941 : *
14942 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
14943 : * result.flags = PyBUF_RECORDS
14944 : * else:
14945 : */
14946 338 : __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
14947 338 : if (__pyx_t_1) {
14948 :
14949 : /* "View.MemoryView":1028
14950 : *
14951 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
14952 : * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
14953 : * else:
14954 : * result.flags = PyBUF_RECORDS_RO
14955 : */
14956 338 : __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
14957 :
14958 : /* "View.MemoryView":1027
14959 : * Py_INCREF(Py_None)
14960 : *
14961 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
14962 : * result.flags = PyBUF_RECORDS
14963 : * else:
14964 : */
14965 338 : goto __pyx_L4;
14966 : }
14967 :
14968 : /* "View.MemoryView":1030
14969 : * result.flags = PyBUF_RECORDS
14970 : * else:
14971 : * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
14972 : *
14973 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape
14974 : */
14975 : /*else*/ {
14976 0 : __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
14977 : }
14978 338 : __pyx_L4:;
14979 :
14980 : /* "View.MemoryView":1032
14981 : * result.flags = PyBUF_RECORDS_RO
14982 : *
14983 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
14984 : * result.view.strides = <Py_ssize_t *> result.from_slice.strides
14985 : *
14986 : */
14987 338 : __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
14988 :
14989 : /* "View.MemoryView":1033
14990 : *
14991 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape
14992 : * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
14993 : *
14994 : *
14995 : */
14996 338 : __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
14997 :
14998 : /* "View.MemoryView":1036
14999 : *
15000 : *
15001 : * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
15002 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15003 : * if suboffset >= 0:
15004 : */
15005 338 : __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15006 :
15007 : /* "View.MemoryView":1037
15008 : *
15009 : * result.view.suboffsets = NULL
15010 : * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
15011 : * if suboffset >= 0:
15012 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15013 : */
15014 338 : __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15015 676 : for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15016 338 : __pyx_t_6 = __pyx_t_8;
15017 338 : __pyx_v_suboffset = (__pyx_t_6[0]);
15018 :
15019 : /* "View.MemoryView":1038
15020 : * result.view.suboffsets = NULL
15021 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15022 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15023 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15024 : * break
15025 : */
15026 338 : __pyx_t_1 = (__pyx_v_suboffset >= 0);
15027 338 : if (__pyx_t_1) {
15028 :
15029 : /* "View.MemoryView":1039
15030 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15031 : * if suboffset >= 0:
15032 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
15033 : * break
15034 : *
15035 : */
15036 0 : __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15037 :
15038 : /* "View.MemoryView":1040
15039 : * if suboffset >= 0:
15040 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15041 : * break # <<<<<<<<<<<<<<
15042 : *
15043 : * result.view.len = result.view.itemsize
15044 : */
15045 0 : goto __pyx_L6_break;
15046 :
15047 : /* "View.MemoryView":1038
15048 : * result.view.suboffsets = NULL
15049 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15050 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15051 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15052 : * break
15053 : */
15054 : }
15055 : }
15056 338 : __pyx_L6_break:;
15057 :
15058 : /* "View.MemoryView":1042
15059 : * break
15060 : *
15061 : * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
15062 : * for length in result.view.shape[:ndim]:
15063 : * result.view.len *= length
15064 : */
15065 338 : __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15066 338 : __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15067 :
15068 : /* "View.MemoryView":1043
15069 : *
15070 : * result.view.len = result.view.itemsize
15071 : * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
15072 : * result.view.len *= length
15073 : *
15074 : */
15075 338 : __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15076 676 : for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15077 338 : __pyx_t_6 = __pyx_t_8;
15078 338 : __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
15079 338 : __Pyx_GOTREF(__pyx_t_2);
15080 338 : __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
15081 338 : __pyx_t_2 = 0;
15082 :
15083 : /* "View.MemoryView":1044
15084 : * result.view.len = result.view.itemsize
15085 : * for length in result.view.shape[:ndim]:
15086 : * result.view.len *= length # <<<<<<<<<<<<<<
15087 : *
15088 : * result.to_object_func = to_object_func
15089 : */
15090 338 : __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
15091 338 : __Pyx_GOTREF(__pyx_t_2);
15092 338 : __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
15093 338 : __Pyx_GOTREF(__pyx_t_3);
15094 338 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15095 338 : __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
15096 338 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15097 338 : __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15098 : }
15099 :
15100 : /* "View.MemoryView":1046
15101 : * result.view.len *= length
15102 : *
15103 : * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
15104 : * result.to_dtype_func = to_dtype_func
15105 : *
15106 : */
15107 338 : __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15108 :
15109 : /* "View.MemoryView":1047
15110 : *
15111 : * result.to_object_func = to_object_func
15112 : * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
15113 : *
15114 : * return result
15115 : */
15116 338 : __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15117 :
15118 : /* "View.MemoryView":1049
15119 : * result.to_dtype_func = to_dtype_func
15120 : *
15121 : * return result # <<<<<<<<<<<<<<
15122 : *
15123 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
15124 : */
15125 338 : __Pyx_XDECREF(__pyx_r);
15126 338 : __Pyx_INCREF((PyObject *)__pyx_v_result);
15127 338 : __pyx_r = ((PyObject *)__pyx_v_result);
15128 338 : goto __pyx_L0;
15129 :
15130 : /* "View.MemoryView":999
15131 : *
15132 : * @cname('__pyx_memoryview_fromslice')
15133 : * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
15134 : * int ndim,
15135 : * object (*to_object_func)(char *),
15136 : */
15137 :
15138 : /* function exit code */
15139 0 : __pyx_L1_error:;
15140 0 : __Pyx_XDECREF(__pyx_t_2);
15141 0 : __Pyx_XDECREF(__pyx_t_3);
15142 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15143 0 : __pyx_r = 0;
15144 338 : __pyx_L0:;
15145 338 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
15146 338 : __Pyx_XDECREF(__pyx_v_length);
15147 338 : __Pyx_XGIVEREF(__pyx_r);
15148 338 : __Pyx_RefNannyFinishContext();
15149 338 : return __pyx_r;
15150 : }
15151 :
15152 : /* "View.MemoryView":1052
15153 : *
15154 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
15155 : * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
15156 : * __Pyx_memviewslice *mslice) except NULL:
15157 : * cdef _memoryviewslice obj
15158 : */
15159 :
15160 0 : static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15161 0 : struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15162 0 : __Pyx_memviewslice *__pyx_r;
15163 : __Pyx_RefNannyDeclarations
15164 0 : int __pyx_t_1;
15165 0 : PyObject *__pyx_t_2 = NULL;
15166 0 : int __pyx_lineno = 0;
15167 0 : const char *__pyx_filename = NULL;
15168 0 : int __pyx_clineno = 0;
15169 0 : __Pyx_RefNannySetupContext("get_slice_from_memview", 1);
15170 :
15171 : /* "View.MemoryView":1055
15172 : * __Pyx_memviewslice *mslice) except NULL:
15173 : * cdef _memoryviewslice obj
15174 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15175 : * obj = memview
15176 : * return &obj.from_slice
15177 : */
15178 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15179 0 : if (__pyx_t_1) {
15180 :
15181 : /* "View.MemoryView":1056
15182 : * cdef _memoryviewslice obj
15183 : * if isinstance(memview, _memoryviewslice):
15184 : * obj = memview # <<<<<<<<<<<<<<
15185 : * return &obj.from_slice
15186 : * else:
15187 : */
15188 0 : if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
15189 0 : __pyx_t_2 = ((PyObject *)__pyx_v_memview);
15190 0 : __Pyx_INCREF(__pyx_t_2);
15191 0 : __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15192 0 : __pyx_t_2 = 0;
15193 :
15194 : /* "View.MemoryView":1057
15195 : * if isinstance(memview, _memoryviewslice):
15196 : * obj = memview
15197 : * return &obj.from_slice # <<<<<<<<<<<<<<
15198 : * else:
15199 : * slice_copy(memview, mslice)
15200 : */
15201 0 : __pyx_r = (&__pyx_v_obj->from_slice);
15202 0 : goto __pyx_L0;
15203 :
15204 : /* "View.MemoryView":1055
15205 : * __Pyx_memviewslice *mslice) except NULL:
15206 : * cdef _memoryviewslice obj
15207 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15208 : * obj = memview
15209 : * return &obj.from_slice
15210 : */
15211 : }
15212 :
15213 : /* "View.MemoryView":1059
15214 : * return &obj.from_slice
15215 : * else:
15216 : * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
15217 : * return mslice
15218 : *
15219 : */
15220 : /*else*/ {
15221 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15222 :
15223 : /* "View.MemoryView":1060
15224 : * else:
15225 : * slice_copy(memview, mslice)
15226 : * return mslice # <<<<<<<<<<<<<<
15227 : *
15228 : * @cname('__pyx_memoryview_slice_copy')
15229 : */
15230 0 : __pyx_r = __pyx_v_mslice;
15231 0 : goto __pyx_L0;
15232 : }
15233 :
15234 : /* "View.MemoryView":1052
15235 : *
15236 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
15237 : * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
15238 : * __Pyx_memviewslice *mslice) except NULL:
15239 : * cdef _memoryviewslice obj
15240 : */
15241 :
15242 : /* function exit code */
15243 0 : __pyx_L1_error:;
15244 0 : __Pyx_XDECREF(__pyx_t_2);
15245 0 : __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
15246 0 : __pyx_r = NULL;
15247 0 : __pyx_L0:;
15248 0 : __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15249 0 : __Pyx_RefNannyFinishContext();
15250 0 : return __pyx_r;
15251 : }
15252 :
15253 : /* "View.MemoryView":1063
15254 : *
15255 : * @cname('__pyx_memoryview_slice_copy')
15256 : * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
15257 : * cdef int dim
15258 : * cdef (Py_ssize_t*) shape, strides, suboffsets
15259 : */
15260 :
15261 0 : static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
15262 0 : int __pyx_v_dim;
15263 0 : Py_ssize_t *__pyx_v_shape;
15264 0 : Py_ssize_t *__pyx_v_strides;
15265 0 : Py_ssize_t *__pyx_v_suboffsets;
15266 0 : Py_ssize_t *__pyx_t_1;
15267 0 : int __pyx_t_2;
15268 0 : int __pyx_t_3;
15269 0 : int __pyx_t_4;
15270 0 : Py_ssize_t __pyx_t_5;
15271 0 : int __pyx_t_6;
15272 :
15273 : /* "View.MemoryView":1067
15274 : * cdef (Py_ssize_t*) shape, strides, suboffsets
15275 : *
15276 : * shape = memview.view.shape # <<<<<<<<<<<<<<
15277 : * strides = memview.view.strides
15278 : * suboffsets = memview.view.suboffsets
15279 : */
15280 0 : __pyx_t_1 = __pyx_v_memview->view.shape;
15281 0 : __pyx_v_shape = __pyx_t_1;
15282 :
15283 : /* "View.MemoryView":1068
15284 : *
15285 : * shape = memview.view.shape
15286 : * strides = memview.view.strides # <<<<<<<<<<<<<<
15287 : * suboffsets = memview.view.suboffsets
15288 : *
15289 : */
15290 0 : __pyx_t_1 = __pyx_v_memview->view.strides;
15291 0 : __pyx_v_strides = __pyx_t_1;
15292 :
15293 : /* "View.MemoryView":1069
15294 : * shape = memview.view.shape
15295 : * strides = memview.view.strides
15296 : * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
15297 : *
15298 : * dst.memview = <__pyx_memoryview *> memview
15299 : */
15300 0 : __pyx_t_1 = __pyx_v_memview->view.suboffsets;
15301 0 : __pyx_v_suboffsets = __pyx_t_1;
15302 :
15303 : /* "View.MemoryView":1071
15304 : * suboffsets = memview.view.suboffsets
15305 : *
15306 : * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
15307 : * dst.data = <char *> memview.view.buf
15308 : *
15309 : */
15310 0 : __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
15311 :
15312 : /* "View.MemoryView":1072
15313 : *
15314 : * dst.memview = <__pyx_memoryview *> memview
15315 : * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
15316 : *
15317 : * for dim in range(memview.view.ndim):
15318 : */
15319 0 : __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
15320 :
15321 : /* "View.MemoryView":1074
15322 : * dst.data = <char *> memview.view.buf
15323 : *
15324 : * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
15325 : * dst.shape[dim] = shape[dim]
15326 : * dst.strides[dim] = strides[dim]
15327 : */
15328 0 : __pyx_t_2 = __pyx_v_memview->view.ndim;
15329 0 : __pyx_t_3 = __pyx_t_2;
15330 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15331 0 : __pyx_v_dim = __pyx_t_4;
15332 :
15333 : /* "View.MemoryView":1075
15334 : *
15335 : * for dim in range(memview.view.ndim):
15336 : * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
15337 : * dst.strides[dim] = strides[dim]
15338 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15339 : */
15340 0 : (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
15341 :
15342 : /* "View.MemoryView":1076
15343 : * for dim in range(memview.view.ndim):
15344 : * dst.shape[dim] = shape[dim]
15345 : * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
15346 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15347 : *
15348 : */
15349 0 : (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
15350 :
15351 : /* "View.MemoryView":1077
15352 : * dst.shape[dim] = shape[dim]
15353 : * dst.strides[dim] = strides[dim]
15354 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
15355 : *
15356 : * @cname('__pyx_memoryview_copy_object')
15357 : */
15358 0 : __pyx_t_6 = (__pyx_v_suboffsets != 0);
15359 0 : if (__pyx_t_6) {
15360 0 : __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
15361 : } else {
15362 : __pyx_t_5 = -1L;
15363 : }
15364 0 : (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
15365 : }
15366 :
15367 : /* "View.MemoryView":1063
15368 : *
15369 : * @cname('__pyx_memoryview_slice_copy')
15370 : * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
15371 : * cdef int dim
15372 : * cdef (Py_ssize_t*) shape, strides, suboffsets
15373 : */
15374 :
15375 : /* function exit code */
15376 0 : }
15377 :
15378 : /* "View.MemoryView":1080
15379 : *
15380 : * @cname('__pyx_memoryview_copy_object')
15381 : * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
15382 : * "Create a new memoryview object"
15383 : * cdef __Pyx_memviewslice memviewslice
15384 : */
15385 :
15386 0 : static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
15387 0 : __Pyx_memviewslice __pyx_v_memviewslice;
15388 0 : PyObject *__pyx_r = NULL;
15389 : __Pyx_RefNannyDeclarations
15390 0 : PyObject *__pyx_t_1 = NULL;
15391 0 : int __pyx_lineno = 0;
15392 0 : const char *__pyx_filename = NULL;
15393 0 : int __pyx_clineno = 0;
15394 0 : __Pyx_RefNannySetupContext("memoryview_copy", 1);
15395 :
15396 : /* "View.MemoryView":1083
15397 : * "Create a new memoryview object"
15398 : * cdef __Pyx_memviewslice memviewslice
15399 : * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
15400 : * return memoryview_copy_from_slice(memview, &memviewslice)
15401 : *
15402 : */
15403 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
15404 :
15405 : /* "View.MemoryView":1084
15406 : * cdef __Pyx_memviewslice memviewslice
15407 : * slice_copy(memview, &memviewslice)
15408 : * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
15409 : *
15410 : * @cname('__pyx_memoryview_copy_object_from_slice')
15411 : */
15412 0 : __Pyx_XDECREF(__pyx_r);
15413 0 : __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
15414 0 : __Pyx_GOTREF(__pyx_t_1);
15415 0 : __pyx_r = __pyx_t_1;
15416 0 : __pyx_t_1 = 0;
15417 0 : goto __pyx_L0;
15418 :
15419 : /* "View.MemoryView":1080
15420 : *
15421 : * @cname('__pyx_memoryview_copy_object')
15422 : * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
15423 : * "Create a new memoryview object"
15424 : * cdef __Pyx_memviewslice memviewslice
15425 : */
15426 :
15427 : /* function exit code */
15428 0 : __pyx_L1_error:;
15429 0 : __Pyx_XDECREF(__pyx_t_1);
15430 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15431 0 : __pyx_r = 0;
15432 0 : __pyx_L0:;
15433 0 : __Pyx_XGIVEREF(__pyx_r);
15434 0 : __Pyx_RefNannyFinishContext();
15435 0 : return __pyx_r;
15436 : }
15437 :
15438 : /* "View.MemoryView":1087
15439 : *
15440 : * @cname('__pyx_memoryview_copy_object_from_slice')
15441 : * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
15442 : * """
15443 : * Create a new memoryview object from a given memoryview object and slice.
15444 : */
15445 :
15446 0 : static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
15447 0 : PyObject *(*__pyx_v_to_object_func)(char *);
15448 0 : int (*__pyx_v_to_dtype_func)(char *, PyObject *);
15449 0 : PyObject *__pyx_r = NULL;
15450 : __Pyx_RefNannyDeclarations
15451 0 : int __pyx_t_1;
15452 0 : PyObject *(*__pyx_t_2)(char *);
15453 0 : int (*__pyx_t_3)(char *, PyObject *);
15454 0 : PyObject *__pyx_t_4 = NULL;
15455 0 : int __pyx_lineno = 0;
15456 0 : const char *__pyx_filename = NULL;
15457 0 : int __pyx_clineno = 0;
15458 0 : __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 1);
15459 :
15460 : /* "View.MemoryView":1094
15461 : * cdef int (*to_dtype_func)(char *, object) except 0
15462 : *
15463 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15464 : * to_object_func = (<_memoryviewslice> memview).to_object_func
15465 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15466 : */
15467 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15468 0 : if (__pyx_t_1) {
15469 :
15470 : /* "View.MemoryView":1095
15471 : *
15472 : * if isinstance(memview, _memoryviewslice):
15473 : * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
15474 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15475 : * else:
15476 : */
15477 0 : __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
15478 0 : __pyx_v_to_object_func = __pyx_t_2;
15479 :
15480 : /* "View.MemoryView":1096
15481 : * if isinstance(memview, _memoryviewslice):
15482 : * to_object_func = (<_memoryviewslice> memview).to_object_func
15483 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
15484 : * else:
15485 : * to_object_func = NULL
15486 : */
15487 0 : __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
15488 0 : __pyx_v_to_dtype_func = __pyx_t_3;
15489 :
15490 : /* "View.MemoryView":1094
15491 : * cdef int (*to_dtype_func)(char *, object) except 0
15492 : *
15493 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15494 : * to_object_func = (<_memoryviewslice> memview).to_object_func
15495 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15496 : */
15497 0 : goto __pyx_L3;
15498 : }
15499 :
15500 : /* "View.MemoryView":1098
15501 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15502 : * else:
15503 : * to_object_func = NULL # <<<<<<<<<<<<<<
15504 : * to_dtype_func = NULL
15505 : *
15506 : */
15507 : /*else*/ {
15508 : __pyx_v_to_object_func = NULL;
15509 :
15510 : /* "View.MemoryView":1099
15511 : * else:
15512 : * to_object_func = NULL
15513 : * to_dtype_func = NULL # <<<<<<<<<<<<<<
15514 : *
15515 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15516 : */
15517 : __pyx_v_to_dtype_func = NULL;
15518 : }
15519 0 : __pyx_L3:;
15520 :
15521 : /* "View.MemoryView":1101
15522 : * to_dtype_func = NULL
15523 : *
15524 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
15525 : * to_object_func, to_dtype_func,
15526 : * memview.dtype_is_object)
15527 : */
15528 0 : __Pyx_XDECREF(__pyx_r);
15529 :
15530 : /* "View.MemoryView":1103
15531 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15532 : * to_object_func, to_dtype_func,
15533 : * memview.dtype_is_object) # <<<<<<<<<<<<<<
15534 : *
15535 : *
15536 : */
15537 0 : __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1101, __pyx_L1_error)
15538 0 : __Pyx_GOTREF(__pyx_t_4);
15539 0 : __pyx_r = __pyx_t_4;
15540 0 : __pyx_t_4 = 0;
15541 0 : goto __pyx_L0;
15542 :
15543 : /* "View.MemoryView":1087
15544 : *
15545 : * @cname('__pyx_memoryview_copy_object_from_slice')
15546 : * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
15547 : * """
15548 : * Create a new memoryview object from a given memoryview object and slice.
15549 : */
15550 :
15551 : /* function exit code */
15552 0 : __pyx_L1_error:;
15553 0 : __Pyx_XDECREF(__pyx_t_4);
15554 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15555 0 : __pyx_r = 0;
15556 0 : __pyx_L0:;
15557 0 : __Pyx_XGIVEREF(__pyx_r);
15558 0 : __Pyx_RefNannyFinishContext();
15559 0 : return __pyx_r;
15560 : }
15561 :
15562 : /* "View.MemoryView":1109
15563 : *
15564 : *
15565 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
15566 : * return -arg if arg < 0 else arg
15567 : *
15568 : */
15569 :
15570 0 : static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
15571 0 : Py_ssize_t __pyx_r;
15572 0 : Py_ssize_t __pyx_t_1;
15573 0 : int __pyx_t_2;
15574 :
15575 : /* "View.MemoryView":1110
15576 : *
15577 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
15578 : * return -arg if arg < 0 else arg # <<<<<<<<<<<<<<
15579 : *
15580 : * @cname('__pyx_get_best_slice_order')
15581 : */
15582 0 : __pyx_t_2 = (__pyx_v_arg < 0);
15583 0 : if (__pyx_t_2) {
15584 : __pyx_t_1 = (-__pyx_v_arg);
15585 : } else {
15586 : __pyx_t_1 = __pyx_v_arg;
15587 : }
15588 0 : __pyx_r = __pyx_t_1;
15589 0 : goto __pyx_L0;
15590 :
15591 : /* "View.MemoryView":1109
15592 : *
15593 : *
15594 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
15595 : * return -arg if arg < 0 else arg
15596 : *
15597 : */
15598 :
15599 : /* function exit code */
15600 0 : __pyx_L0:;
15601 0 : return __pyx_r;
15602 : }
15603 :
15604 : /* "View.MemoryView":1113
15605 : *
15606 : * @cname('__pyx_get_best_slice_order')
15607 : * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
15608 : * """
15609 : * Figure out the best memory access order for a given slice.
15610 : */
15611 :
15612 0 : static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
15613 0 : int __pyx_v_i;
15614 0 : Py_ssize_t __pyx_v_c_stride;
15615 0 : Py_ssize_t __pyx_v_f_stride;
15616 0 : char __pyx_r;
15617 0 : int __pyx_t_1;
15618 0 : int __pyx_t_2;
15619 0 : int __pyx_t_3;
15620 0 : int __pyx_t_4;
15621 :
15622 : /* "View.MemoryView":1118
15623 : * """
15624 : * cdef int i
15625 : * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
15626 : * cdef Py_ssize_t f_stride = 0
15627 : *
15628 : */
15629 0 : __pyx_v_c_stride = 0;
15630 :
15631 : /* "View.MemoryView":1119
15632 : * cdef int i
15633 : * cdef Py_ssize_t c_stride = 0
15634 : * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
15635 : *
15636 : * for i in range(ndim - 1, -1, -1):
15637 : */
15638 0 : __pyx_v_f_stride = 0;
15639 :
15640 : /* "View.MemoryView":1121
15641 : * cdef Py_ssize_t f_stride = 0
15642 : *
15643 : * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
15644 : * if mslice.shape[i] > 1:
15645 : * c_stride = mslice.strides[i]
15646 : */
15647 0 : for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
15648 0 : __pyx_v_i = __pyx_t_1;
15649 :
15650 : /* "View.MemoryView":1122
15651 : *
15652 : * for i in range(ndim - 1, -1, -1):
15653 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15654 : * c_stride = mslice.strides[i]
15655 : * break
15656 : */
15657 0 : __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
15658 0 : if (__pyx_t_2) {
15659 :
15660 : /* "View.MemoryView":1123
15661 : * for i in range(ndim - 1, -1, -1):
15662 : * if mslice.shape[i] > 1:
15663 : * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
15664 : * break
15665 : *
15666 : */
15667 0 : __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15668 :
15669 : /* "View.MemoryView":1124
15670 : * if mslice.shape[i] > 1:
15671 : * c_stride = mslice.strides[i]
15672 : * break # <<<<<<<<<<<<<<
15673 : *
15674 : * for i in range(ndim):
15675 : */
15676 0 : goto __pyx_L4_break;
15677 :
15678 : /* "View.MemoryView":1122
15679 : *
15680 : * for i in range(ndim - 1, -1, -1):
15681 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15682 : * c_stride = mslice.strides[i]
15683 : * break
15684 : */
15685 : }
15686 : }
15687 0 : __pyx_L4_break:;
15688 :
15689 : /* "View.MemoryView":1126
15690 : * break
15691 : *
15692 : * for i in range(ndim): # <<<<<<<<<<<<<<
15693 : * if mslice.shape[i] > 1:
15694 : * f_stride = mslice.strides[i]
15695 : */
15696 0 : __pyx_t_1 = __pyx_v_ndim;
15697 0 : __pyx_t_3 = __pyx_t_1;
15698 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15699 0 : __pyx_v_i = __pyx_t_4;
15700 :
15701 : /* "View.MemoryView":1127
15702 : *
15703 : * for i in range(ndim):
15704 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15705 : * f_stride = mslice.strides[i]
15706 : * break
15707 : */
15708 0 : __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
15709 0 : if (__pyx_t_2) {
15710 :
15711 : /* "View.MemoryView":1128
15712 : * for i in range(ndim):
15713 : * if mslice.shape[i] > 1:
15714 : * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
15715 : * break
15716 : *
15717 : */
15718 0 : __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15719 :
15720 : /* "View.MemoryView":1129
15721 : * if mslice.shape[i] > 1:
15722 : * f_stride = mslice.strides[i]
15723 : * break # <<<<<<<<<<<<<<
15724 : *
15725 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
15726 : */
15727 0 : goto __pyx_L7_break;
15728 :
15729 : /* "View.MemoryView":1127
15730 : *
15731 : * for i in range(ndim):
15732 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15733 : * f_stride = mslice.strides[i]
15734 : * break
15735 : */
15736 : }
15737 : }
15738 0 : __pyx_L7_break:;
15739 :
15740 : /* "View.MemoryView":1131
15741 : * break
15742 : *
15743 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
15744 : * return 'C'
15745 : * else:
15746 : */
15747 0 : __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
15748 0 : if (__pyx_t_2) {
15749 :
15750 : /* "View.MemoryView":1132
15751 : *
15752 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
15753 : * return 'C' # <<<<<<<<<<<<<<
15754 : * else:
15755 : * return 'F'
15756 : */
15757 0 : __pyx_r = 'C';
15758 0 : goto __pyx_L0;
15759 :
15760 : /* "View.MemoryView":1131
15761 : * break
15762 : *
15763 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
15764 : * return 'C'
15765 : * else:
15766 : */
15767 : }
15768 :
15769 : /* "View.MemoryView":1134
15770 : * return 'C'
15771 : * else:
15772 : * return 'F' # <<<<<<<<<<<<<<
15773 : *
15774 : * @cython.cdivision(True)
15775 : */
15776 : /*else*/ {
15777 0 : __pyx_r = 'F';
15778 0 : goto __pyx_L0;
15779 : }
15780 :
15781 : /* "View.MemoryView":1113
15782 : *
15783 : * @cname('__pyx_get_best_slice_order')
15784 : * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
15785 : * """
15786 : * Figure out the best memory access order for a given slice.
15787 : */
15788 :
15789 : /* function exit code */
15790 0 : __pyx_L0:;
15791 0 : return __pyx_r;
15792 : }
15793 :
15794 : /* "View.MemoryView":1137
15795 : *
15796 : * @cython.cdivision(True)
15797 : * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
15798 : * char *dst_data, Py_ssize_t *dst_strides,
15799 : * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
15800 : */
15801 :
15802 0 : static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
15803 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
15804 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
15805 0 : Py_ssize_t __pyx_v_dst_extent;
15806 0 : Py_ssize_t __pyx_v_src_stride;
15807 0 : Py_ssize_t __pyx_v_dst_stride;
15808 0 : int __pyx_t_1;
15809 0 : int __pyx_t_2;
15810 0 : Py_ssize_t __pyx_t_3;
15811 0 : Py_ssize_t __pyx_t_4;
15812 0 : Py_ssize_t __pyx_t_5;
15813 :
15814 : /* "View.MemoryView":1144
15815 : *
15816 : * cdef Py_ssize_t i
15817 : * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
15818 : * cdef Py_ssize_t dst_extent = dst_shape[0]
15819 : * cdef Py_ssize_t src_stride = src_strides[0]
15820 : */
15821 0 : __pyx_v_src_extent = (__pyx_v_src_shape[0]);
15822 :
15823 : /* "View.MemoryView":1145
15824 : * cdef Py_ssize_t i
15825 : * cdef Py_ssize_t src_extent = src_shape[0]
15826 : * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
15827 : * cdef Py_ssize_t src_stride = src_strides[0]
15828 : * cdef Py_ssize_t dst_stride = dst_strides[0]
15829 : */
15830 0 : __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
15831 :
15832 : /* "View.MemoryView":1146
15833 : * cdef Py_ssize_t src_extent = src_shape[0]
15834 : * cdef Py_ssize_t dst_extent = dst_shape[0]
15835 : * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
15836 : * cdef Py_ssize_t dst_stride = dst_strides[0]
15837 : *
15838 : */
15839 0 : __pyx_v_src_stride = (__pyx_v_src_strides[0]);
15840 :
15841 : /* "View.MemoryView":1147
15842 : * cdef Py_ssize_t dst_extent = dst_shape[0]
15843 : * cdef Py_ssize_t src_stride = src_strides[0]
15844 : * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
15845 : *
15846 : * if ndim == 1:
15847 : */
15848 0 : __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
15849 :
15850 : /* "View.MemoryView":1149
15851 : * cdef Py_ssize_t dst_stride = dst_strides[0]
15852 : *
15853 : * if ndim == 1: # <<<<<<<<<<<<<<
15854 : * if (src_stride > 0 and dst_stride > 0 and
15855 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
15856 : */
15857 0 : __pyx_t_1 = (__pyx_v_ndim == 1);
15858 0 : if (__pyx_t_1) {
15859 :
15860 : /* "View.MemoryView":1150
15861 : *
15862 : * if ndim == 1:
15863 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
15864 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
15865 : * memcpy(dst_data, src_data, itemsize * dst_extent)
15866 : */
15867 0 : __pyx_t_2 = (__pyx_v_src_stride > 0);
15868 0 : if (__pyx_t_2) {
15869 0 : } else {
15870 0 : __pyx_t_1 = __pyx_t_2;
15871 0 : goto __pyx_L5_bool_binop_done;
15872 : }
15873 0 : __pyx_t_2 = (__pyx_v_dst_stride > 0);
15874 0 : if (__pyx_t_2) {
15875 0 : } else {
15876 0 : __pyx_t_1 = __pyx_t_2;
15877 0 : goto __pyx_L5_bool_binop_done;
15878 : }
15879 :
15880 : /* "View.MemoryView":1151
15881 : * if ndim == 1:
15882 : * if (src_stride > 0 and dst_stride > 0 and
15883 : * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
15884 : * memcpy(dst_data, src_data, itemsize * dst_extent)
15885 : * else:
15886 : */
15887 0 : __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
15888 0 : if (__pyx_t_2) {
15889 0 : __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
15890 : }
15891 : __pyx_t_1 = __pyx_t_2;
15892 0 : __pyx_L5_bool_binop_done:;
15893 :
15894 : /* "View.MemoryView":1150
15895 : *
15896 : * if ndim == 1:
15897 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
15898 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
15899 : * memcpy(dst_data, src_data, itemsize * dst_extent)
15900 : */
15901 0 : if (__pyx_t_1) {
15902 :
15903 : /* "View.MemoryView":1152
15904 : * if (src_stride > 0 and dst_stride > 0 and
15905 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
15906 : * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
15907 : * else:
15908 : * for i in range(dst_extent):
15909 : */
15910 0 : (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
15911 :
15912 : /* "View.MemoryView":1150
15913 : *
15914 : * if ndim == 1:
15915 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
15916 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
15917 : * memcpy(dst_data, src_data, itemsize * dst_extent)
15918 : */
15919 0 : goto __pyx_L4;
15920 : }
15921 :
15922 : /* "View.MemoryView":1154
15923 : * memcpy(dst_data, src_data, itemsize * dst_extent)
15924 : * else:
15925 : * for i in range(dst_extent): # <<<<<<<<<<<<<<
15926 : * memcpy(dst_data, src_data, itemsize)
15927 : * src_data += src_stride
15928 : */
15929 : /*else*/ {
15930 : __pyx_t_3 = __pyx_v_dst_extent;
15931 : __pyx_t_4 = __pyx_t_3;
15932 0 : for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
15933 0 : __pyx_v_i = __pyx_t_5;
15934 :
15935 : /* "View.MemoryView":1155
15936 : * else:
15937 : * for i in range(dst_extent):
15938 : * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
15939 : * src_data += src_stride
15940 : * dst_data += dst_stride
15941 : */
15942 0 : (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
15943 :
15944 : /* "View.MemoryView":1156
15945 : * for i in range(dst_extent):
15946 : * memcpy(dst_data, src_data, itemsize)
15947 : * src_data += src_stride # <<<<<<<<<<<<<<
15948 : * dst_data += dst_stride
15949 : * else:
15950 : */
15951 0 : __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
15952 :
15953 : /* "View.MemoryView":1157
15954 : * memcpy(dst_data, src_data, itemsize)
15955 : * src_data += src_stride
15956 : * dst_data += dst_stride # <<<<<<<<<<<<<<
15957 : * else:
15958 : * for i in range(dst_extent):
15959 : */
15960 0 : __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
15961 : }
15962 : }
15963 0 : __pyx_L4:;
15964 :
15965 : /* "View.MemoryView":1149
15966 : * cdef Py_ssize_t dst_stride = dst_strides[0]
15967 : *
15968 : * if ndim == 1: # <<<<<<<<<<<<<<
15969 : * if (src_stride > 0 and dst_stride > 0 and
15970 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
15971 : */
15972 0 : goto __pyx_L3;
15973 : }
15974 :
15975 : /* "View.MemoryView":1159
15976 : * dst_data += dst_stride
15977 : * else:
15978 : * for i in range(dst_extent): # <<<<<<<<<<<<<<
15979 : * _copy_strided_to_strided(src_data, src_strides + 1,
15980 : * dst_data, dst_strides + 1,
15981 : */
15982 : /*else*/ {
15983 : __pyx_t_3 = __pyx_v_dst_extent;
15984 : __pyx_t_4 = __pyx_t_3;
15985 0 : for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
15986 0 : __pyx_v_i = __pyx_t_5;
15987 :
15988 : /* "View.MemoryView":1160
15989 : * else:
15990 : * for i in range(dst_extent):
15991 : * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
15992 : * dst_data, dst_strides + 1,
15993 : * src_shape + 1, dst_shape + 1,
15994 : */
15995 0 : _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
15996 :
15997 : /* "View.MemoryView":1164
15998 : * src_shape + 1, dst_shape + 1,
15999 : * ndim - 1, itemsize)
16000 : * src_data += src_stride # <<<<<<<<<<<<<<
16001 : * dst_data += dst_stride
16002 : *
16003 : */
16004 0 : __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16005 :
16006 : /* "View.MemoryView":1165
16007 : * ndim - 1, itemsize)
16008 : * src_data += src_stride
16009 : * dst_data += dst_stride # <<<<<<<<<<<<<<
16010 : *
16011 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
16012 : */
16013 0 : __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16014 : }
16015 : }
16016 0 : __pyx_L3:;
16017 :
16018 : /* "View.MemoryView":1137
16019 : *
16020 : * @cython.cdivision(True)
16021 : * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
16022 : * char *dst_data, Py_ssize_t *dst_strides,
16023 : * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
16024 : */
16025 :
16026 : /* function exit code */
16027 0 : }
16028 :
16029 : /* "View.MemoryView":1167
16030 : * dst_data += dst_stride
16031 : *
16032 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16033 : * __Pyx_memviewslice *dst,
16034 : * int ndim, size_t itemsize) noexcept nogil:
16035 : */
16036 :
16037 0 : static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16038 :
16039 : /* "View.MemoryView":1170
16040 : * __Pyx_memviewslice *dst,
16041 : * int ndim, size_t itemsize) noexcept nogil:
16042 : * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
16043 : * src.shape, dst.shape, ndim, itemsize)
16044 : *
16045 : */
16046 0 : _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
16047 :
16048 : /* "View.MemoryView":1167
16049 : * dst_data += dst_stride
16050 : *
16051 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16052 : * __Pyx_memviewslice *dst,
16053 : * int ndim, size_t itemsize) noexcept nogil:
16054 : */
16055 :
16056 : /* function exit code */
16057 0 : }
16058 :
16059 : /* "View.MemoryView":1174
16060 : *
16061 : * @cname('__pyx_memoryview_slice_get_size')
16062 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16063 : * "Return the size of the memory occupied by the slice in number of bytes"
16064 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16065 : */
16066 :
16067 0 : static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
16068 0 : Py_ssize_t __pyx_v_shape;
16069 0 : Py_ssize_t __pyx_v_size;
16070 0 : Py_ssize_t __pyx_r;
16071 0 : Py_ssize_t __pyx_t_1;
16072 0 : Py_ssize_t *__pyx_t_2;
16073 0 : Py_ssize_t *__pyx_t_3;
16074 0 : Py_ssize_t *__pyx_t_4;
16075 :
16076 : /* "View.MemoryView":1176
16077 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16078 : * "Return the size of the memory occupied by the slice in number of bytes"
16079 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
16080 : *
16081 : * for shape in src.shape[:ndim]:
16082 : */
16083 0 : __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
16084 0 : __pyx_v_size = __pyx_t_1;
16085 :
16086 : /* "View.MemoryView":1178
16087 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16088 : *
16089 : * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
16090 : * size *= shape
16091 : *
16092 : */
16093 0 : __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
16094 0 : for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
16095 0 : __pyx_t_2 = __pyx_t_4;
16096 0 : __pyx_v_shape = (__pyx_t_2[0]);
16097 :
16098 : /* "View.MemoryView":1179
16099 : *
16100 : * for shape in src.shape[:ndim]:
16101 : * size *= shape # <<<<<<<<<<<<<<
16102 : *
16103 : * return size
16104 : */
16105 0 : __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
16106 : }
16107 :
16108 : /* "View.MemoryView":1181
16109 : * size *= shape
16110 : *
16111 : * return size # <<<<<<<<<<<<<<
16112 : *
16113 : * @cname('__pyx_fill_contig_strides_array')
16114 : */
16115 0 : __pyx_r = __pyx_v_size;
16116 0 : goto __pyx_L0;
16117 :
16118 : /* "View.MemoryView":1174
16119 : *
16120 : * @cname('__pyx_memoryview_slice_get_size')
16121 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16122 : * "Return the size of the memory occupied by the slice in number of bytes"
16123 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16124 : */
16125 :
16126 : /* function exit code */
16127 0 : __pyx_L0:;
16128 0 : return __pyx_r;
16129 : }
16130 :
16131 : /* "View.MemoryView":1184
16132 : *
16133 : * @cname('__pyx_fill_contig_strides_array')
16134 : * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
16135 : * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16136 : * int ndim, char order) noexcept nogil:
16137 : */
16138 :
16139 0 : static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
16140 0 : int __pyx_v_idx;
16141 0 : Py_ssize_t __pyx_r;
16142 0 : int __pyx_t_1;
16143 0 : int __pyx_t_2;
16144 0 : int __pyx_t_3;
16145 0 : int __pyx_t_4;
16146 :
16147 : /* "View.MemoryView":1193
16148 : * cdef int idx
16149 : *
16150 : * if order == 'F': # <<<<<<<<<<<<<<
16151 : * for idx in range(ndim):
16152 : * strides[idx] = stride
16153 : */
16154 0 : __pyx_t_1 = (__pyx_v_order == 'F');
16155 0 : if (__pyx_t_1) {
16156 :
16157 : /* "View.MemoryView":1194
16158 : *
16159 : * if order == 'F':
16160 : * for idx in range(ndim): # <<<<<<<<<<<<<<
16161 : * strides[idx] = stride
16162 : * stride *= shape[idx]
16163 : */
16164 0 : __pyx_t_2 = __pyx_v_ndim;
16165 : __pyx_t_3 = __pyx_t_2;
16166 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16167 0 : __pyx_v_idx = __pyx_t_4;
16168 :
16169 : /* "View.MemoryView":1195
16170 : * if order == 'F':
16171 : * for idx in range(ndim):
16172 : * strides[idx] = stride # <<<<<<<<<<<<<<
16173 : * stride *= shape[idx]
16174 : * else:
16175 : */
16176 0 : (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16177 :
16178 : /* "View.MemoryView":1196
16179 : * for idx in range(ndim):
16180 : * strides[idx] = stride
16181 : * stride *= shape[idx] # <<<<<<<<<<<<<<
16182 : * else:
16183 : * for idx in range(ndim - 1, -1, -1):
16184 : */
16185 0 : __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16186 : }
16187 :
16188 : /* "View.MemoryView":1193
16189 : * cdef int idx
16190 : *
16191 : * if order == 'F': # <<<<<<<<<<<<<<
16192 : * for idx in range(ndim):
16193 : * strides[idx] = stride
16194 : */
16195 0 : goto __pyx_L3;
16196 : }
16197 :
16198 : /* "View.MemoryView":1198
16199 : * stride *= shape[idx]
16200 : * else:
16201 : * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
16202 : * strides[idx] = stride
16203 : * stride *= shape[idx]
16204 : */
16205 : /*else*/ {
16206 0 : for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
16207 0 : __pyx_v_idx = __pyx_t_2;
16208 :
16209 : /* "View.MemoryView":1199
16210 : * else:
16211 : * for idx in range(ndim - 1, -1, -1):
16212 : * strides[idx] = stride # <<<<<<<<<<<<<<
16213 : * stride *= shape[idx]
16214 : *
16215 : */
16216 0 : (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16217 :
16218 : /* "View.MemoryView":1200
16219 : * for idx in range(ndim - 1, -1, -1):
16220 : * strides[idx] = stride
16221 : * stride *= shape[idx] # <<<<<<<<<<<<<<
16222 : *
16223 : * return stride
16224 : */
16225 0 : __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16226 : }
16227 : }
16228 0 : __pyx_L3:;
16229 :
16230 : /* "View.MemoryView":1202
16231 : * stride *= shape[idx]
16232 : *
16233 : * return stride # <<<<<<<<<<<<<<
16234 : *
16235 : * @cname('__pyx_memoryview_copy_data_to_temp')
16236 : */
16237 0 : __pyx_r = __pyx_v_stride;
16238 0 : goto __pyx_L0;
16239 :
16240 : /* "View.MemoryView":1184
16241 : *
16242 : * @cname('__pyx_fill_contig_strides_array')
16243 : * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
16244 : * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16245 : * int ndim, char order) noexcept nogil:
16246 : */
16247 :
16248 : /* function exit code */
16249 0 : __pyx_L0:;
16250 0 : return __pyx_r;
16251 : }
16252 :
16253 : /* "View.MemoryView":1205
16254 : *
16255 : * @cname('__pyx_memoryview_copy_data_to_temp')
16256 : * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16257 : * __Pyx_memviewslice *tmpslice,
16258 : * char order,
16259 : */
16260 :
16261 0 : static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
16262 0 : int __pyx_v_i;
16263 0 : void *__pyx_v_result;
16264 0 : size_t __pyx_v_itemsize;
16265 0 : size_t __pyx_v_size;
16266 0 : void *__pyx_r;
16267 0 : Py_ssize_t __pyx_t_1;
16268 0 : int __pyx_t_2;
16269 0 : int __pyx_t_3;
16270 0 : struct __pyx_memoryview_obj *__pyx_t_4;
16271 0 : int __pyx_t_5;
16272 0 : int __pyx_t_6;
16273 0 : int __pyx_lineno = 0;
16274 0 : const char *__pyx_filename = NULL;
16275 0 : int __pyx_clineno = 0;
16276 : #ifdef WITH_THREAD
16277 0 : PyGILState_STATE __pyx_gilstate_save;
16278 : #endif
16279 :
16280 : /* "View.MemoryView":1216
16281 : * cdef void *result
16282 : *
16283 : * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
16284 : * cdef size_t size = slice_get_size(src, ndim)
16285 : *
16286 : */
16287 0 : __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
16288 0 : __pyx_v_itemsize = __pyx_t_1;
16289 :
16290 : /* "View.MemoryView":1217
16291 : *
16292 : * cdef size_t itemsize = src.memview.view.itemsize
16293 : * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
16294 : *
16295 : * result = malloc(size)
16296 : */
16297 0 : __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
16298 :
16299 : /* "View.MemoryView":1219
16300 : * cdef size_t size = slice_get_size(src, ndim)
16301 : *
16302 : * result = malloc(size) # <<<<<<<<<<<<<<
16303 : * if not result:
16304 : * _err_no_memory()
16305 : */
16306 0 : __pyx_v_result = malloc(__pyx_v_size);
16307 :
16308 : /* "View.MemoryView":1220
16309 : *
16310 : * result = malloc(size)
16311 : * if not result: # <<<<<<<<<<<<<<
16312 : * _err_no_memory()
16313 : *
16314 : */
16315 0 : __pyx_t_2 = (!(__pyx_v_result != 0));
16316 0 : if (__pyx_t_2) {
16317 :
16318 : /* "View.MemoryView":1221
16319 : * result = malloc(size)
16320 : * if not result:
16321 : * _err_no_memory() # <<<<<<<<<<<<<<
16322 : *
16323 : *
16324 : */
16325 0 : __pyx_t_3 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
16326 :
16327 : /* "View.MemoryView":1220
16328 : *
16329 : * result = malloc(size)
16330 : * if not result: # <<<<<<<<<<<<<<
16331 : * _err_no_memory()
16332 : *
16333 : */
16334 : }
16335 :
16336 : /* "View.MemoryView":1224
16337 : *
16338 : *
16339 : * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
16340 : * tmpslice.memview = src.memview
16341 : * for i in range(ndim):
16342 : */
16343 0 : __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
16344 :
16345 : /* "View.MemoryView":1225
16346 : *
16347 : * tmpslice.data = <char *> result
16348 : * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
16349 : * for i in range(ndim):
16350 : * tmpslice.shape[i] = src.shape[i]
16351 : */
16352 0 : __pyx_t_4 = __pyx_v_src->memview;
16353 0 : __pyx_v_tmpslice->memview = __pyx_t_4;
16354 :
16355 : /* "View.MemoryView":1226
16356 : * tmpslice.data = <char *> result
16357 : * tmpslice.memview = src.memview
16358 : * for i in range(ndim): # <<<<<<<<<<<<<<
16359 : * tmpslice.shape[i] = src.shape[i]
16360 : * tmpslice.suboffsets[i] = -1
16361 : */
16362 0 : __pyx_t_3 = __pyx_v_ndim;
16363 0 : __pyx_t_5 = __pyx_t_3;
16364 0 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16365 0 : __pyx_v_i = __pyx_t_6;
16366 :
16367 : /* "View.MemoryView":1227
16368 : * tmpslice.memview = src.memview
16369 : * for i in range(ndim):
16370 : * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
16371 : * tmpslice.suboffsets[i] = -1
16372 : *
16373 : */
16374 0 : (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
16375 :
16376 : /* "View.MemoryView":1228
16377 : * for i in range(ndim):
16378 : * tmpslice.shape[i] = src.shape[i]
16379 : * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
16380 : *
16381 : * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order)
16382 : */
16383 0 : (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
16384 : }
16385 :
16386 : /* "View.MemoryView":1230
16387 : * tmpslice.suboffsets[i] = -1
16388 : *
16389 : * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order) # <<<<<<<<<<<<<<
16390 : *
16391 : *
16392 : */
16393 0 : (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
16394 :
16395 : /* "View.MemoryView":1233
16396 : *
16397 : *
16398 : * for i in range(ndim): # <<<<<<<<<<<<<<
16399 : * if tmpslice.shape[i] == 1:
16400 : * tmpslice.strides[i] = 0
16401 : */
16402 0 : __pyx_t_3 = __pyx_v_ndim;
16403 0 : __pyx_t_5 = __pyx_t_3;
16404 0 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16405 0 : __pyx_v_i = __pyx_t_6;
16406 :
16407 : /* "View.MemoryView":1234
16408 : *
16409 : * for i in range(ndim):
16410 : * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16411 : * tmpslice.strides[i] = 0
16412 : *
16413 : */
16414 0 : __pyx_t_2 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
16415 0 : if (__pyx_t_2) {
16416 :
16417 : /* "View.MemoryView":1235
16418 : * for i in range(ndim):
16419 : * if tmpslice.shape[i] == 1:
16420 : * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
16421 : *
16422 : * if slice_is_contig(src[0], order, ndim):
16423 : */
16424 0 : (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
16425 :
16426 : /* "View.MemoryView":1234
16427 : *
16428 : * for i in range(ndim):
16429 : * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16430 : * tmpslice.strides[i] = 0
16431 : *
16432 : */
16433 : }
16434 : }
16435 :
16436 : /* "View.MemoryView":1237
16437 : * tmpslice.strides[i] = 0
16438 : *
16439 : * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16440 : * memcpy(result, src.data, size)
16441 : * else:
16442 : */
16443 0 : __pyx_t_2 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
16444 0 : if (__pyx_t_2) {
16445 :
16446 : /* "View.MemoryView":1238
16447 : *
16448 : * if slice_is_contig(src[0], order, ndim):
16449 : * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
16450 : * else:
16451 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16452 : */
16453 0 : (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
16454 :
16455 : /* "View.MemoryView":1237
16456 : * tmpslice.strides[i] = 0
16457 : *
16458 : * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16459 : * memcpy(result, src.data, size)
16460 : * else:
16461 : */
16462 0 : goto __pyx_L9;
16463 : }
16464 :
16465 : /* "View.MemoryView":1240
16466 : * memcpy(result, src.data, size)
16467 : * else:
16468 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
16469 : *
16470 : * return result
16471 : */
16472 : /*else*/ {
16473 0 : copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
16474 : }
16475 0 : __pyx_L9:;
16476 :
16477 : /* "View.MemoryView":1242
16478 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16479 : *
16480 : * return result # <<<<<<<<<<<<<<
16481 : *
16482 : *
16483 : */
16484 0 : __pyx_r = __pyx_v_result;
16485 0 : goto __pyx_L0;
16486 :
16487 : /* "View.MemoryView":1205
16488 : *
16489 : * @cname('__pyx_memoryview_copy_data_to_temp')
16490 : * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16491 : * __Pyx_memviewslice *tmpslice,
16492 : * char order,
16493 : */
16494 :
16495 : /* function exit code */
16496 0 : __pyx_L1_error:;
16497 : #ifdef WITH_THREAD
16498 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16499 : #endif
16500 0 : __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
16501 0 : __pyx_r = NULL;
16502 : #ifdef WITH_THREAD
16503 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16504 : #endif
16505 0 : __pyx_L0:;
16506 0 : return __pyx_r;
16507 : }
16508 :
16509 : /* "View.MemoryView":1247
16510 : *
16511 : * @cname('__pyx_memoryview_err_extents')
16512 : * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
16513 : * Py_ssize_t extent2) except -1 with gil:
16514 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
16515 : */
16516 :
16517 0 : static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
16518 0 : int __pyx_r;
16519 : __Pyx_RefNannyDeclarations
16520 0 : PyObject *__pyx_t_1 = NULL;
16521 0 : Py_ssize_t __pyx_t_2;
16522 0 : Py_UCS4 __pyx_t_3;
16523 0 : PyObject *__pyx_t_4 = NULL;
16524 0 : int __pyx_lineno = 0;
16525 0 : const char *__pyx_filename = NULL;
16526 0 : int __pyx_clineno = 0;
16527 : #ifdef WITH_THREAD
16528 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16529 : #endif
16530 0 : __Pyx_RefNannySetupContext("_err_extents", 0);
16531 :
16532 : /* "View.MemoryView":1249
16533 : * cdef int _err_extents(int i, Py_ssize_t extent1,
16534 : * Py_ssize_t extent2) except -1 with gil:
16535 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})" # <<<<<<<<<<<<<<
16536 : *
16537 : * @cname('__pyx_memoryview_err_dim')
16538 : */
16539 0 : __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1249, __pyx_L1_error)
16540 0 : __Pyx_GOTREF(__pyx_t_1);
16541 0 : __pyx_t_2 = 0;
16542 0 : __pyx_t_3 = 127;
16543 0 : __Pyx_INCREF(__pyx_kp_u_got_differing_extents_in_dimensi);
16544 0 : __pyx_t_2 += 35;
16545 0 : __Pyx_GIVEREF(__pyx_kp_u_got_differing_extents_in_dimensi);
16546 0 : PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_got_differing_extents_in_dimensi);
16547 0 : __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16548 0 : __Pyx_GOTREF(__pyx_t_4);
16549 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16550 0 : __Pyx_GIVEREF(__pyx_t_4);
16551 0 : PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
16552 0 : __pyx_t_4 = 0;
16553 0 : __Pyx_INCREF(__pyx_kp_u_got);
16554 0 : __pyx_t_2 += 6;
16555 0 : __Pyx_GIVEREF(__pyx_kp_u_got);
16556 0 : PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_got);
16557 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent1, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16558 0 : __Pyx_GOTREF(__pyx_t_4);
16559 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16560 0 : __Pyx_GIVEREF(__pyx_t_4);
16561 0 : PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
16562 0 : __pyx_t_4 = 0;
16563 0 : __Pyx_INCREF(__pyx_kp_u_and);
16564 0 : __pyx_t_2 += 5;
16565 0 : __Pyx_GIVEREF(__pyx_kp_u_and);
16566 0 : PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_and);
16567 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent2, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16568 0 : __Pyx_GOTREF(__pyx_t_4);
16569 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16570 0 : __Pyx_GIVEREF(__pyx_t_4);
16571 0 : PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
16572 0 : __pyx_t_4 = 0;
16573 0 : __Pyx_INCREF(__pyx_kp_u__7);
16574 0 : __pyx_t_2 += 1;
16575 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
16576 0 : PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__7);
16577 0 : __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16578 0 : __Pyx_GOTREF(__pyx_t_4);
16579 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16580 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_4, 0, 0);
16581 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16582 0 : __PYX_ERR(1, 1249, __pyx_L1_error)
16583 :
16584 : /* "View.MemoryView":1247
16585 : *
16586 : * @cname('__pyx_memoryview_err_extents')
16587 : * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
16588 : * Py_ssize_t extent2) except -1 with gil:
16589 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
16590 : */
16591 :
16592 : /* function exit code */
16593 0 : __pyx_L1_error:;
16594 0 : __Pyx_XDECREF(__pyx_t_1);
16595 0 : __Pyx_XDECREF(__pyx_t_4);
16596 0 : __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
16597 0 : __pyx_r = -1;
16598 0 : __Pyx_RefNannyFinishContext();
16599 : #ifdef WITH_THREAD
16600 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16601 : #endif
16602 0 : return __pyx_r;
16603 : }
16604 :
16605 : /* "View.MemoryView":1252
16606 : *
16607 : * @cname('__pyx_memoryview_err_dim')
16608 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
16609 : * raise <object>error, msg % dim
16610 : *
16611 : */
16612 :
16613 0 : static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, PyObject *__pyx_v_msg, int __pyx_v_dim) {
16614 0 : int __pyx_r;
16615 : __Pyx_RefNannyDeclarations
16616 0 : PyObject *__pyx_t_1 = NULL;
16617 0 : PyObject *__pyx_t_2 = NULL;
16618 0 : int __pyx_lineno = 0;
16619 0 : const char *__pyx_filename = NULL;
16620 0 : int __pyx_clineno = 0;
16621 : #ifdef WITH_THREAD
16622 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16623 : #endif
16624 0 : __Pyx_RefNannySetupContext("_err_dim", 0);
16625 0 : __Pyx_INCREF(__pyx_v_msg);
16626 :
16627 : /* "View.MemoryView":1253
16628 : * @cname('__pyx_memoryview_err_dim')
16629 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
16630 : * raise <object>error, msg % dim # <<<<<<<<<<<<<<
16631 : *
16632 : * @cname('__pyx_memoryview_err')
16633 : */
16634 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1253, __pyx_L1_error)
16635 0 : __Pyx_GOTREF(__pyx_t_1);
16636 0 : __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1253, __pyx_L1_error)
16637 0 : __Pyx_GOTREF(__pyx_t_2);
16638 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16639 0 : __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_t_2, 0, 0);
16640 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16641 0 : __PYX_ERR(1, 1253, __pyx_L1_error)
16642 :
16643 : /* "View.MemoryView":1252
16644 : *
16645 : * @cname('__pyx_memoryview_err_dim')
16646 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
16647 : * raise <object>error, msg % dim
16648 : *
16649 : */
16650 :
16651 : /* function exit code */
16652 0 : __pyx_L1_error:;
16653 0 : __Pyx_XDECREF(__pyx_t_1);
16654 0 : __Pyx_XDECREF(__pyx_t_2);
16655 0 : __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
16656 0 : __pyx_r = -1;
16657 0 : __Pyx_XDECREF(__pyx_v_msg);
16658 0 : __Pyx_RefNannyFinishContext();
16659 : #ifdef WITH_THREAD
16660 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16661 : #endif
16662 0 : return __pyx_r;
16663 : }
16664 :
16665 : /* "View.MemoryView":1256
16666 : *
16667 : * @cname('__pyx_memoryview_err')
16668 : * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<<
16669 : * raise <object>error, msg
16670 : *
16671 : */
16672 :
16673 0 : static int __pyx_memoryview_err(PyObject *__pyx_v_error, PyObject *__pyx_v_msg) {
16674 0 : int __pyx_r;
16675 : __Pyx_RefNannyDeclarations
16676 0 : int __pyx_lineno = 0;
16677 0 : const char *__pyx_filename = NULL;
16678 0 : int __pyx_clineno = 0;
16679 : #ifdef WITH_THREAD
16680 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16681 : #endif
16682 0 : __Pyx_RefNannySetupContext("_err", 0);
16683 0 : __Pyx_INCREF(__pyx_v_msg);
16684 :
16685 : /* "View.MemoryView":1257
16686 : * @cname('__pyx_memoryview_err')
16687 : * cdef int _err(PyObject *error, str msg) except -1 with gil:
16688 : * raise <object>error, msg # <<<<<<<<<<<<<<
16689 : *
16690 : * @cname('__pyx_memoryview_err_no_memory')
16691 : */
16692 0 : __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_v_msg, 0, 0);
16693 0 : __PYX_ERR(1, 1257, __pyx_L1_error)
16694 :
16695 : /* "View.MemoryView":1256
16696 : *
16697 : * @cname('__pyx_memoryview_err')
16698 : * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<<
16699 : * raise <object>error, msg
16700 : *
16701 : */
16702 :
16703 : /* function exit code */
16704 0 : __pyx_L1_error:;
16705 0 : __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
16706 0 : __pyx_r = -1;
16707 0 : __Pyx_XDECREF(__pyx_v_msg);
16708 0 : __Pyx_RefNannyFinishContext();
16709 : #ifdef WITH_THREAD
16710 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16711 : #endif
16712 0 : return __pyx_r;
16713 : }
16714 :
16715 : /* "View.MemoryView":1260
16716 : *
16717 : * @cname('__pyx_memoryview_err_no_memory')
16718 : * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<<
16719 : * raise MemoryError
16720 : *
16721 : */
16722 :
16723 0 : static int __pyx_memoryview_err_no_memory(void) {
16724 0 : int __pyx_r;
16725 0 : int __pyx_lineno = 0;
16726 0 : const char *__pyx_filename = NULL;
16727 0 : int __pyx_clineno = 0;
16728 : #ifdef WITH_THREAD
16729 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16730 : #endif
16731 :
16732 : /* "View.MemoryView":1261
16733 : * @cname('__pyx_memoryview_err_no_memory')
16734 : * cdef int _err_no_memory() except -1 with gil:
16735 : * raise MemoryError # <<<<<<<<<<<<<<
16736 : *
16737 : *
16738 : */
16739 0 : PyErr_NoMemory(); __PYX_ERR(1, 1261, __pyx_L1_error)
16740 :
16741 : /* "View.MemoryView":1260
16742 : *
16743 : * @cname('__pyx_memoryview_err_no_memory')
16744 : * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<<
16745 : * raise MemoryError
16746 : *
16747 : */
16748 :
16749 : /* function exit code */
16750 0 : __pyx_L1_error:;
16751 0 : __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
16752 0 : __pyx_r = -1;
16753 : #ifdef WITH_THREAD
16754 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16755 : #endif
16756 0 : return __pyx_r;
16757 : }
16758 :
16759 : /* "View.MemoryView":1265
16760 : *
16761 : * @cname('__pyx_memoryview_copy_contents')
16762 : * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
16763 : * __Pyx_memviewslice dst,
16764 : * int src_ndim, int dst_ndim,
16765 : */
16766 :
16767 0 : static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
16768 0 : void *__pyx_v_tmpdata;
16769 0 : size_t __pyx_v_itemsize;
16770 0 : int __pyx_v_i;
16771 0 : char __pyx_v_order;
16772 0 : int __pyx_v_broadcasting;
16773 0 : int __pyx_v_direct_copy;
16774 0 : __Pyx_memviewslice __pyx_v_tmp;
16775 0 : int __pyx_v_ndim;
16776 0 : int __pyx_r;
16777 0 : Py_ssize_t __pyx_t_1;
16778 0 : int __pyx_t_2;
16779 0 : int __pyx_t_3;
16780 0 : int __pyx_t_4;
16781 0 : int __pyx_t_5;
16782 0 : int __pyx_t_6;
16783 0 : void *__pyx_t_7;
16784 0 : int __pyx_lineno = 0;
16785 0 : const char *__pyx_filename = NULL;
16786 0 : int __pyx_clineno = 0;
16787 : #ifdef WITH_THREAD
16788 0 : PyGILState_STATE __pyx_gilstate_save;
16789 : #endif
16790 :
16791 : /* "View.MemoryView":1273
16792 : * Check for overlapping memory and verify the shapes.
16793 : * """
16794 : * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
16795 : * cdef size_t itemsize = src.memview.view.itemsize
16796 : * cdef int i
16797 : */
16798 0 : __pyx_v_tmpdata = NULL;
16799 :
16800 : /* "View.MemoryView":1274
16801 : * """
16802 : * cdef void *tmpdata = NULL
16803 : * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
16804 : * cdef int i
16805 : * cdef char order = get_best_order(&src, src_ndim)
16806 : */
16807 0 : __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
16808 0 : __pyx_v_itemsize = __pyx_t_1;
16809 :
16810 : /* "View.MemoryView":1276
16811 : * cdef size_t itemsize = src.memview.view.itemsize
16812 : * cdef int i
16813 : * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
16814 : * cdef bint broadcasting = False
16815 : * cdef bint direct_copy = False
16816 : */
16817 0 : __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
16818 :
16819 : /* "View.MemoryView":1277
16820 : * cdef int i
16821 : * cdef char order = get_best_order(&src, src_ndim)
16822 : * cdef bint broadcasting = False # <<<<<<<<<<<<<<
16823 : * cdef bint direct_copy = False
16824 : * cdef __Pyx_memviewslice tmp
16825 : */
16826 0 : __pyx_v_broadcasting = 0;
16827 :
16828 : /* "View.MemoryView":1278
16829 : * cdef char order = get_best_order(&src, src_ndim)
16830 : * cdef bint broadcasting = False
16831 : * cdef bint direct_copy = False # <<<<<<<<<<<<<<
16832 : * cdef __Pyx_memviewslice tmp
16833 : *
16834 : */
16835 0 : __pyx_v_direct_copy = 0;
16836 :
16837 : /* "View.MemoryView":1281
16838 : * cdef __Pyx_memviewslice tmp
16839 : *
16840 : * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
16841 : * broadcast_leading(&src, src_ndim, dst_ndim)
16842 : * elif dst_ndim < src_ndim:
16843 : */
16844 0 : __pyx_t_2 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
16845 0 : if (__pyx_t_2) {
16846 :
16847 : /* "View.MemoryView":1282
16848 : *
16849 : * if src_ndim < dst_ndim:
16850 : * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
16851 : * elif dst_ndim < src_ndim:
16852 : * broadcast_leading(&dst, dst_ndim, src_ndim)
16853 : */
16854 0 : __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
16855 :
16856 : /* "View.MemoryView":1281
16857 : * cdef __Pyx_memviewslice tmp
16858 : *
16859 : * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
16860 : * broadcast_leading(&src, src_ndim, dst_ndim)
16861 : * elif dst_ndim < src_ndim:
16862 : */
16863 0 : goto __pyx_L3;
16864 : }
16865 :
16866 : /* "View.MemoryView":1283
16867 : * if src_ndim < dst_ndim:
16868 : * broadcast_leading(&src, src_ndim, dst_ndim)
16869 : * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
16870 : * broadcast_leading(&dst, dst_ndim, src_ndim)
16871 : *
16872 : */
16873 0 : __pyx_t_2 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
16874 0 : if (__pyx_t_2) {
16875 :
16876 : /* "View.MemoryView":1284
16877 : * broadcast_leading(&src, src_ndim, dst_ndim)
16878 : * elif dst_ndim < src_ndim:
16879 : * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
16880 : *
16881 : * cdef int ndim = max(src_ndim, dst_ndim)
16882 : */
16883 0 : __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
16884 :
16885 : /* "View.MemoryView":1283
16886 : * if src_ndim < dst_ndim:
16887 : * broadcast_leading(&src, src_ndim, dst_ndim)
16888 : * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
16889 : * broadcast_leading(&dst, dst_ndim, src_ndim)
16890 : *
16891 : */
16892 : }
16893 0 : __pyx_L3:;
16894 :
16895 : /* "View.MemoryView":1286
16896 : * broadcast_leading(&dst, dst_ndim, src_ndim)
16897 : *
16898 : * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
16899 : *
16900 : * for i in range(ndim):
16901 : */
16902 0 : __pyx_t_3 = __pyx_v_dst_ndim;
16903 0 : __pyx_t_4 = __pyx_v_src_ndim;
16904 0 : __pyx_t_2 = (__pyx_t_3 > __pyx_t_4);
16905 0 : if (__pyx_t_2) {
16906 : __pyx_t_5 = __pyx_t_3;
16907 : } else {
16908 : __pyx_t_5 = __pyx_t_4;
16909 : }
16910 0 : __pyx_v_ndim = __pyx_t_5;
16911 :
16912 : /* "View.MemoryView":1288
16913 : * cdef int ndim = max(src_ndim, dst_ndim)
16914 : *
16915 : * for i in range(ndim): # <<<<<<<<<<<<<<
16916 : * if src.shape[i] != dst.shape[i]:
16917 : * if src.shape[i] == 1:
16918 : */
16919 0 : __pyx_t_5 = __pyx_v_ndim;
16920 0 : __pyx_t_3 = __pyx_t_5;
16921 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16922 0 : __pyx_v_i = __pyx_t_4;
16923 :
16924 : /* "View.MemoryView":1289
16925 : *
16926 : * for i in range(ndim):
16927 : * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
16928 : * if src.shape[i] == 1:
16929 : * broadcasting = True
16930 : */
16931 0 : __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
16932 0 : if (__pyx_t_2) {
16933 :
16934 : /* "View.MemoryView":1290
16935 : * for i in range(ndim):
16936 : * if src.shape[i] != dst.shape[i]:
16937 : * if src.shape[i] == 1: # <<<<<<<<<<<<<<
16938 : * broadcasting = True
16939 : * src.strides[i] = 0
16940 : */
16941 0 : __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
16942 0 : if (__pyx_t_2) {
16943 :
16944 : /* "View.MemoryView":1291
16945 : * if src.shape[i] != dst.shape[i]:
16946 : * if src.shape[i] == 1:
16947 : * broadcasting = True # <<<<<<<<<<<<<<
16948 : * src.strides[i] = 0
16949 : * else:
16950 : */
16951 0 : __pyx_v_broadcasting = 1;
16952 :
16953 : /* "View.MemoryView":1292
16954 : * if src.shape[i] == 1:
16955 : * broadcasting = True
16956 : * src.strides[i] = 0 # <<<<<<<<<<<<<<
16957 : * else:
16958 : * _err_extents(i, dst.shape[i], src.shape[i])
16959 : */
16960 0 : (__pyx_v_src.strides[__pyx_v_i]) = 0;
16961 :
16962 : /* "View.MemoryView":1290
16963 : * for i in range(ndim):
16964 : * if src.shape[i] != dst.shape[i]:
16965 : * if src.shape[i] == 1: # <<<<<<<<<<<<<<
16966 : * broadcasting = True
16967 : * src.strides[i] = 0
16968 : */
16969 0 : goto __pyx_L7;
16970 : }
16971 :
16972 : /* "View.MemoryView":1294
16973 : * src.strides[i] = 0
16974 : * else:
16975 : * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
16976 : *
16977 : * if src.suboffsets[i] >= 0:
16978 : */
16979 : /*else*/ {
16980 0 : __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1294, __pyx_L1_error)
16981 : }
16982 0 : __pyx_L7:;
16983 :
16984 : /* "View.MemoryView":1289
16985 : *
16986 : * for i in range(ndim):
16987 : * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
16988 : * if src.shape[i] == 1:
16989 : * broadcasting = True
16990 : */
16991 : }
16992 :
16993 : /* "View.MemoryView":1296
16994 : * _err_extents(i, dst.shape[i], src.shape[i])
16995 : *
16996 : * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
16997 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
16998 : *
16999 : */
17000 0 : __pyx_t_2 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17001 0 : if (__pyx_t_2) {
17002 :
17003 : /* "View.MemoryView":1297
17004 : *
17005 : * if src.suboffsets[i] >= 0:
17006 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
17007 : *
17008 : * if slices_overlap(&src, &dst, ndim, itemsize):
17009 : */
17010 0 : __pyx_t_6 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
17011 :
17012 : /* "View.MemoryView":1296
17013 : * _err_extents(i, dst.shape[i], src.shape[i])
17014 : *
17015 : * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
17016 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17017 : *
17018 : */
17019 : }
17020 : }
17021 :
17022 : /* "View.MemoryView":1299
17023 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17024 : *
17025 : * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17026 : *
17027 : * if not slice_is_contig(src, order, ndim):
17028 : */
17029 0 : __pyx_t_2 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17030 0 : if (__pyx_t_2) {
17031 :
17032 : /* "View.MemoryView":1301
17033 : * if slices_overlap(&src, &dst, ndim, itemsize):
17034 : *
17035 : * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17036 : * order = get_best_order(&dst, ndim)
17037 : *
17038 : */
17039 0 : __pyx_t_2 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
17040 0 : if (__pyx_t_2) {
17041 :
17042 : /* "View.MemoryView":1302
17043 : *
17044 : * if not slice_is_contig(src, order, ndim):
17045 : * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
17046 : *
17047 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17048 : */
17049 0 : __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17050 :
17051 : /* "View.MemoryView":1301
17052 : * if slices_overlap(&src, &dst, ndim, itemsize):
17053 : *
17054 : * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17055 : * order = get_best_order(&dst, ndim)
17056 : *
17057 : */
17058 : }
17059 :
17060 : /* "View.MemoryView":1304
17061 : * order = get_best_order(&dst, ndim)
17062 : *
17063 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
17064 : * src = tmp
17065 : *
17066 : */
17067 0 : __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1304, __pyx_L1_error)
17068 0 : __pyx_v_tmpdata = __pyx_t_7;
17069 :
17070 : /* "View.MemoryView":1305
17071 : *
17072 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17073 : * src = tmp # <<<<<<<<<<<<<<
17074 : *
17075 : * if not broadcasting:
17076 : */
17077 0 : __pyx_v_src = __pyx_v_tmp;
17078 :
17079 : /* "View.MemoryView":1299
17080 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17081 : *
17082 : * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17083 : *
17084 : * if not slice_is_contig(src, order, ndim):
17085 : */
17086 : }
17087 :
17088 : /* "View.MemoryView":1307
17089 : * src = tmp
17090 : *
17091 : * if not broadcasting: # <<<<<<<<<<<<<<
17092 : *
17093 : *
17094 : */
17095 0 : __pyx_t_2 = (!__pyx_v_broadcasting);
17096 0 : if (__pyx_t_2) {
17097 :
17098 : /* "View.MemoryView":1310
17099 : *
17100 : *
17101 : * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17102 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17103 : * elif slice_is_contig(src, 'F', ndim):
17104 : */
17105 0 : __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
17106 0 : if (__pyx_t_2) {
17107 :
17108 : /* "View.MemoryView":1311
17109 : *
17110 : * if slice_is_contig(src, 'C', ndim):
17111 : * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
17112 : * elif slice_is_contig(src, 'F', ndim):
17113 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17114 : */
17115 0 : __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
17116 :
17117 : /* "View.MemoryView":1310
17118 : *
17119 : *
17120 : * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17121 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17122 : * elif slice_is_contig(src, 'F', ndim):
17123 : */
17124 0 : goto __pyx_L12;
17125 : }
17126 :
17127 : /* "View.MemoryView":1312
17128 : * if slice_is_contig(src, 'C', ndim):
17129 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17130 : * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17131 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17132 : *
17133 : */
17134 0 : __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
17135 0 : if (__pyx_t_2) {
17136 :
17137 : /* "View.MemoryView":1313
17138 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17139 : * elif slice_is_contig(src, 'F', ndim):
17140 : * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
17141 : *
17142 : * if direct_copy:
17143 : */
17144 0 : __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
17145 :
17146 : /* "View.MemoryView":1312
17147 : * if slice_is_contig(src, 'C', ndim):
17148 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17149 : * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17150 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17151 : *
17152 : */
17153 : }
17154 0 : __pyx_L12:;
17155 :
17156 : /* "View.MemoryView":1315
17157 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17158 : *
17159 : * if direct_copy: # <<<<<<<<<<<<<<
17160 : *
17161 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17162 : */
17163 0 : if (__pyx_v_direct_copy) {
17164 :
17165 : /* "View.MemoryView":1317
17166 : * if direct_copy:
17167 : *
17168 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17169 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17170 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17171 : */
17172 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17173 :
17174 : /* "View.MemoryView":1318
17175 : *
17176 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17177 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
17178 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17179 : * free(tmpdata)
17180 : */
17181 0 : (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
17182 :
17183 : /* "View.MemoryView":1319
17184 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17185 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17186 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17187 : * free(tmpdata)
17188 : * return 0
17189 : */
17190 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17191 :
17192 : /* "View.MemoryView":1320
17193 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17194 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17195 : * free(tmpdata) # <<<<<<<<<<<<<<
17196 : * return 0
17197 : *
17198 : */
17199 0 : free(__pyx_v_tmpdata);
17200 :
17201 : /* "View.MemoryView":1321
17202 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17203 : * free(tmpdata)
17204 : * return 0 # <<<<<<<<<<<<<<
17205 : *
17206 : * if order == 'F' == get_best_order(&dst, ndim):
17207 : */
17208 0 : __pyx_r = 0;
17209 0 : goto __pyx_L0;
17210 :
17211 : /* "View.MemoryView":1315
17212 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17213 : *
17214 : * if direct_copy: # <<<<<<<<<<<<<<
17215 : *
17216 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17217 : */
17218 : }
17219 :
17220 : /* "View.MemoryView":1307
17221 : * src = tmp
17222 : *
17223 : * if not broadcasting: # <<<<<<<<<<<<<<
17224 : *
17225 : *
17226 : */
17227 : }
17228 :
17229 : /* "View.MemoryView":1323
17230 : * return 0
17231 : *
17232 : * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17233 : *
17234 : *
17235 : */
17236 0 : __pyx_t_2 = (__pyx_v_order == 'F');
17237 0 : if (__pyx_t_2) {
17238 0 : __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
17239 : }
17240 0 : if (__pyx_t_2) {
17241 :
17242 : /* "View.MemoryView":1326
17243 : *
17244 : *
17245 : * transpose_memslice(&src) # <<<<<<<<<<<<<<
17246 : * transpose_memslice(&dst)
17247 : *
17248 : */
17249 0 : __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1326, __pyx_L1_error)
17250 :
17251 : /* "View.MemoryView":1327
17252 : *
17253 : * transpose_memslice(&src)
17254 : * transpose_memslice(&dst) # <<<<<<<<<<<<<<
17255 : *
17256 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17257 : */
17258 0 : __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1327, __pyx_L1_error)
17259 :
17260 : /* "View.MemoryView":1323
17261 : * return 0
17262 : *
17263 : * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17264 : *
17265 : *
17266 : */
17267 : }
17268 :
17269 : /* "View.MemoryView":1329
17270 : * transpose_memslice(&dst)
17271 : *
17272 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17273 : * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17274 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17275 : */
17276 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17277 :
17278 : /* "View.MemoryView":1330
17279 : *
17280 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17281 : * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
17282 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17283 : *
17284 : */
17285 0 : copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17286 :
17287 : /* "View.MemoryView":1331
17288 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17289 : * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17290 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17291 : *
17292 : * free(tmpdata)
17293 : */
17294 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17295 :
17296 : /* "View.MemoryView":1333
17297 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17298 : *
17299 : * free(tmpdata) # <<<<<<<<<<<<<<
17300 : * return 0
17301 : *
17302 : */
17303 0 : free(__pyx_v_tmpdata);
17304 :
17305 : /* "View.MemoryView":1334
17306 : *
17307 : * free(tmpdata)
17308 : * return 0 # <<<<<<<<<<<<<<
17309 : *
17310 : * @cname('__pyx_memoryview_broadcast_leading')
17311 : */
17312 0 : __pyx_r = 0;
17313 0 : goto __pyx_L0;
17314 :
17315 : /* "View.MemoryView":1265
17316 : *
17317 : * @cname('__pyx_memoryview_copy_contents')
17318 : * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
17319 : * __Pyx_memviewslice dst,
17320 : * int src_ndim, int dst_ndim,
17321 : */
17322 :
17323 : /* function exit code */
17324 0 : __pyx_L1_error:;
17325 : #ifdef WITH_THREAD
17326 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17327 : #endif
17328 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17329 0 : __pyx_r = -1;
17330 : #ifdef WITH_THREAD
17331 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17332 : #endif
17333 0 : __pyx_L0:;
17334 0 : return __pyx_r;
17335 : }
17336 :
17337 : /* "View.MemoryView":1337
17338 : *
17339 : * @cname('__pyx_memoryview_broadcast_leading')
17340 : * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
17341 : * int ndim,
17342 : * int ndim_other) noexcept nogil:
17343 : */
17344 :
17345 0 : static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
17346 0 : int __pyx_v_i;
17347 0 : int __pyx_v_offset;
17348 0 : int __pyx_t_1;
17349 0 : int __pyx_t_2;
17350 0 : int __pyx_t_3;
17351 :
17352 : /* "View.MemoryView":1341
17353 : * int ndim_other) noexcept nogil:
17354 : * cdef int i
17355 : * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
17356 : *
17357 : * for i in range(ndim - 1, -1, -1):
17358 : */
17359 0 : __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
17360 :
17361 : /* "View.MemoryView":1343
17362 : * cdef int offset = ndim_other - ndim
17363 : *
17364 : * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17365 : * mslice.shape[i + offset] = mslice.shape[i]
17366 : * mslice.strides[i + offset] = mslice.strides[i]
17367 : */
17368 0 : for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17369 0 : __pyx_v_i = __pyx_t_1;
17370 :
17371 : /* "View.MemoryView":1344
17372 : *
17373 : * for i in range(ndim - 1, -1, -1):
17374 : * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
17375 : * mslice.strides[i + offset] = mslice.strides[i]
17376 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17377 : */
17378 0 : (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
17379 :
17380 : /* "View.MemoryView":1345
17381 : * for i in range(ndim - 1, -1, -1):
17382 : * mslice.shape[i + offset] = mslice.shape[i]
17383 : * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
17384 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17385 : *
17386 : */
17387 0 : (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
17388 :
17389 : /* "View.MemoryView":1346
17390 : * mslice.shape[i + offset] = mslice.shape[i]
17391 : * mslice.strides[i + offset] = mslice.strides[i]
17392 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
17393 : *
17394 : * for i in range(offset):
17395 : */
17396 0 : (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
17397 : }
17398 :
17399 : /* "View.MemoryView":1348
17400 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17401 : *
17402 : * for i in range(offset): # <<<<<<<<<<<<<<
17403 : * mslice.shape[i] = 1
17404 : * mslice.strides[i] = mslice.strides[0]
17405 : */
17406 0 : __pyx_t_1 = __pyx_v_offset;
17407 : __pyx_t_2 = __pyx_t_1;
17408 0 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17409 0 : __pyx_v_i = __pyx_t_3;
17410 :
17411 : /* "View.MemoryView":1349
17412 : *
17413 : * for i in range(offset):
17414 : * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
17415 : * mslice.strides[i] = mslice.strides[0]
17416 : * mslice.suboffsets[i] = -1
17417 : */
17418 0 : (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
17419 :
17420 : /* "View.MemoryView":1350
17421 : * for i in range(offset):
17422 : * mslice.shape[i] = 1
17423 : * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
17424 : * mslice.suboffsets[i] = -1
17425 : *
17426 : */
17427 0 : (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
17428 :
17429 : /* "View.MemoryView":1351
17430 : * mslice.shape[i] = 1
17431 : * mslice.strides[i] = mslice.strides[0]
17432 : * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
17433 : *
17434 : *
17435 : */
17436 0 : (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
17437 : }
17438 :
17439 : /* "View.MemoryView":1337
17440 : *
17441 : * @cname('__pyx_memoryview_broadcast_leading')
17442 : * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
17443 : * int ndim,
17444 : * int ndim_other) noexcept nogil:
17445 : */
17446 :
17447 : /* function exit code */
17448 0 : }
17449 :
17450 : /* "View.MemoryView":1359
17451 : *
17452 : * @cname('__pyx_memoryview_refcount_copying')
17453 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<<
17454 : *
17455 : * if dtype_is_object:
17456 : */
17457 :
17458 0 : static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
17459 :
17460 : /* "View.MemoryView":1361
17461 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17462 : *
17463 : * if dtype_is_object: # <<<<<<<<<<<<<<
17464 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17465 : *
17466 : */
17467 0 : if (__pyx_v_dtype_is_object) {
17468 :
17469 : /* "View.MemoryView":1362
17470 : *
17471 : * if dtype_is_object:
17472 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) # <<<<<<<<<<<<<<
17473 : *
17474 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17475 : */
17476 0 : __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
17477 :
17478 : /* "View.MemoryView":1361
17479 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17480 : *
17481 : * if dtype_is_object: # <<<<<<<<<<<<<<
17482 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17483 : *
17484 : */
17485 : }
17486 :
17487 : /* "View.MemoryView":1359
17488 : *
17489 : * @cname('__pyx_memoryview_refcount_copying')
17490 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<<
17491 : *
17492 : * if dtype_is_object:
17493 : */
17494 :
17495 : /* function exit code */
17496 0 : }
17497 :
17498 : /* "View.MemoryView":1365
17499 : *
17500 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17501 : * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17502 : * Py_ssize_t *strides, int ndim,
17503 : * bint inc) noexcept with gil:
17504 : */
17505 :
17506 0 : static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
17507 : #ifdef WITH_THREAD
17508 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17509 : #endif
17510 :
17511 : /* "View.MemoryView":1368
17512 : * Py_ssize_t *strides, int ndim,
17513 : * bint inc) noexcept with gil:
17514 : * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
17515 : *
17516 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
17517 : */
17518 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
17519 :
17520 : /* "View.MemoryView":1365
17521 : *
17522 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17523 : * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17524 : * Py_ssize_t *strides, int ndim,
17525 : * bint inc) noexcept with gil:
17526 : */
17527 :
17528 : /* function exit code */
17529 : #ifdef WITH_THREAD
17530 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17531 : #endif
17532 0 : }
17533 :
17534 : /* "View.MemoryView":1371
17535 : *
17536 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
17537 : * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17538 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17539 : * cdef Py_ssize_t i
17540 : */
17541 :
17542 0 : static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
17543 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17544 0 : Py_ssize_t __pyx_v_stride;
17545 0 : Py_ssize_t __pyx_t_1;
17546 0 : Py_ssize_t __pyx_t_2;
17547 0 : Py_ssize_t __pyx_t_3;
17548 0 : int __pyx_t_4;
17549 :
17550 : /* "View.MemoryView":1374
17551 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17552 : * cdef Py_ssize_t i
17553 : * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
17554 : *
17555 : * for i in range(shape[0]):
17556 : */
17557 0 : __pyx_v_stride = (__pyx_v_strides[0]);
17558 :
17559 : /* "View.MemoryView":1376
17560 : * cdef Py_ssize_t stride = strides[0]
17561 : *
17562 : * for i in range(shape[0]): # <<<<<<<<<<<<<<
17563 : * if ndim == 1:
17564 : * if inc:
17565 : */
17566 0 : __pyx_t_1 = (__pyx_v_shape[0]);
17567 0 : __pyx_t_2 = __pyx_t_1;
17568 0 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17569 0 : __pyx_v_i = __pyx_t_3;
17570 :
17571 : /* "View.MemoryView":1377
17572 : *
17573 : * for i in range(shape[0]):
17574 : * if ndim == 1: # <<<<<<<<<<<<<<
17575 : * if inc:
17576 : * Py_INCREF((<PyObject **> data)[0])
17577 : */
17578 0 : __pyx_t_4 = (__pyx_v_ndim == 1);
17579 0 : if (__pyx_t_4) {
17580 :
17581 : /* "View.MemoryView":1378
17582 : * for i in range(shape[0]):
17583 : * if ndim == 1:
17584 : * if inc: # <<<<<<<<<<<<<<
17585 : * Py_INCREF((<PyObject **> data)[0])
17586 : * else:
17587 : */
17588 0 : if (__pyx_v_inc) {
17589 :
17590 : /* "View.MemoryView":1379
17591 : * if ndim == 1:
17592 : * if inc:
17593 : * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
17594 : * else:
17595 : * Py_DECREF((<PyObject **> data)[0])
17596 : */
17597 0 : Py_INCREF((((PyObject **)__pyx_v_data)[0]));
17598 :
17599 : /* "View.MemoryView":1378
17600 : * for i in range(shape[0]):
17601 : * if ndim == 1:
17602 : * if inc: # <<<<<<<<<<<<<<
17603 : * Py_INCREF((<PyObject **> data)[0])
17604 : * else:
17605 : */
17606 0 : goto __pyx_L6;
17607 : }
17608 :
17609 : /* "View.MemoryView":1381
17610 : * Py_INCREF((<PyObject **> data)[0])
17611 : * else:
17612 : * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
17613 : * else:
17614 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
17615 : */
17616 : /*else*/ {
17617 0 : Py_DECREF((((PyObject **)__pyx_v_data)[0]));
17618 : }
17619 0 : __pyx_L6:;
17620 :
17621 : /* "View.MemoryView":1377
17622 : *
17623 : * for i in range(shape[0]):
17624 : * if ndim == 1: # <<<<<<<<<<<<<<
17625 : * if inc:
17626 : * Py_INCREF((<PyObject **> data)[0])
17627 : */
17628 0 : goto __pyx_L5;
17629 : }
17630 :
17631 : /* "View.MemoryView":1383
17632 : * Py_DECREF((<PyObject **> data)[0])
17633 : * else:
17634 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) # <<<<<<<<<<<<<<
17635 : *
17636 : * data += stride
17637 : */
17638 : /*else*/ {
17639 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
17640 : }
17641 0 : __pyx_L5:;
17642 :
17643 : /* "View.MemoryView":1385
17644 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
17645 : *
17646 : * data += stride # <<<<<<<<<<<<<<
17647 : *
17648 : *
17649 : */
17650 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
17651 : }
17652 :
17653 : /* "View.MemoryView":1371
17654 : *
17655 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
17656 : * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17657 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17658 : * cdef Py_ssize_t i
17659 : */
17660 :
17661 : /* function exit code */
17662 0 : }
17663 :
17664 : /* "View.MemoryView":1391
17665 : *
17666 : * @cname('__pyx_memoryview_slice_assign_scalar')
17667 : * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
17668 : * size_t itemsize, void *item,
17669 : * bint dtype_is_object) noexcept nogil:
17670 : */
17671 :
17672 0 : static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
17673 :
17674 : /* "View.MemoryView":1394
17675 : * size_t itemsize, void *item,
17676 : * bint dtype_is_object) noexcept nogil:
17677 : * refcount_copying(dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17678 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
17679 : * refcount_copying(dst, dtype_is_object, ndim, inc=True)
17680 : */
17681 0 : __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17682 :
17683 : /* "View.MemoryView":1395
17684 : * bint dtype_is_object) noexcept nogil:
17685 : * refcount_copying(dst, dtype_is_object, ndim, inc=False)
17686 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) # <<<<<<<<<<<<<<
17687 : * refcount_copying(dst, dtype_is_object, ndim, inc=True)
17688 : *
17689 : */
17690 0 : __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
17691 :
17692 : /* "View.MemoryView":1396
17693 : * refcount_copying(dst, dtype_is_object, ndim, inc=False)
17694 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
17695 : * refcount_copying(dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17696 : *
17697 : *
17698 : */
17699 0 : __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17700 :
17701 : /* "View.MemoryView":1391
17702 : *
17703 : * @cname('__pyx_memoryview_slice_assign_scalar')
17704 : * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
17705 : * size_t itemsize, void *item,
17706 : * bint dtype_is_object) noexcept nogil:
17707 : */
17708 :
17709 : /* function exit code */
17710 0 : }
17711 :
17712 : /* "View.MemoryView":1400
17713 : *
17714 : * @cname('__pyx_memoryview__slice_assign_scalar')
17715 : * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17716 : * Py_ssize_t *strides, int ndim,
17717 : * size_t itemsize, void *item) noexcept nogil:
17718 : */
17719 :
17720 0 : static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
17721 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17722 0 : Py_ssize_t __pyx_v_stride;
17723 0 : Py_ssize_t __pyx_v_extent;
17724 0 : int __pyx_t_1;
17725 0 : Py_ssize_t __pyx_t_2;
17726 0 : Py_ssize_t __pyx_t_3;
17727 0 : Py_ssize_t __pyx_t_4;
17728 :
17729 : /* "View.MemoryView":1404
17730 : * size_t itemsize, void *item) noexcept nogil:
17731 : * cdef Py_ssize_t i
17732 : * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
17733 : * cdef Py_ssize_t extent = shape[0]
17734 : *
17735 : */
17736 0 : __pyx_v_stride = (__pyx_v_strides[0]);
17737 :
17738 : /* "View.MemoryView":1405
17739 : * cdef Py_ssize_t i
17740 : * cdef Py_ssize_t stride = strides[0]
17741 : * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
17742 : *
17743 : * if ndim == 1:
17744 : */
17745 0 : __pyx_v_extent = (__pyx_v_shape[0]);
17746 :
17747 : /* "View.MemoryView":1407
17748 : * cdef Py_ssize_t extent = shape[0]
17749 : *
17750 : * if ndim == 1: # <<<<<<<<<<<<<<
17751 : * for i in range(extent):
17752 : * memcpy(data, item, itemsize)
17753 : */
17754 0 : __pyx_t_1 = (__pyx_v_ndim == 1);
17755 0 : if (__pyx_t_1) {
17756 :
17757 : /* "View.MemoryView":1408
17758 : *
17759 : * if ndim == 1:
17760 : * for i in range(extent): # <<<<<<<<<<<<<<
17761 : * memcpy(data, item, itemsize)
17762 : * data += stride
17763 : */
17764 : __pyx_t_2 = __pyx_v_extent;
17765 : __pyx_t_3 = __pyx_t_2;
17766 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17767 0 : __pyx_v_i = __pyx_t_4;
17768 :
17769 : /* "View.MemoryView":1409
17770 : * if ndim == 1:
17771 : * for i in range(extent):
17772 : * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
17773 : * data += stride
17774 : * else:
17775 : */
17776 0 : (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
17777 :
17778 : /* "View.MemoryView":1410
17779 : * for i in range(extent):
17780 : * memcpy(data, item, itemsize)
17781 : * data += stride # <<<<<<<<<<<<<<
17782 : * else:
17783 : * for i in range(extent):
17784 : */
17785 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
17786 : }
17787 :
17788 : /* "View.MemoryView":1407
17789 : * cdef Py_ssize_t extent = shape[0]
17790 : *
17791 : * if ndim == 1: # <<<<<<<<<<<<<<
17792 : * for i in range(extent):
17793 : * memcpy(data, item, itemsize)
17794 : */
17795 0 : goto __pyx_L3;
17796 : }
17797 :
17798 : /* "View.MemoryView":1412
17799 : * data += stride
17800 : * else:
17801 : * for i in range(extent): # <<<<<<<<<<<<<<
17802 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
17803 : * data += stride
17804 : */
17805 : /*else*/ {
17806 : __pyx_t_2 = __pyx_v_extent;
17807 : __pyx_t_3 = __pyx_t_2;
17808 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17809 0 : __pyx_v_i = __pyx_t_4;
17810 :
17811 : /* "View.MemoryView":1413
17812 : * else:
17813 : * for i in range(extent):
17814 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
17815 : * data += stride
17816 : *
17817 : */
17818 0 : __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
17819 :
17820 : /* "View.MemoryView":1414
17821 : * for i in range(extent):
17822 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
17823 : * data += stride # <<<<<<<<<<<<<<
17824 : *
17825 : *
17826 : */
17827 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
17828 : }
17829 : }
17830 0 : __pyx_L3:;
17831 :
17832 : /* "View.MemoryView":1400
17833 : *
17834 : * @cname('__pyx_memoryview__slice_assign_scalar')
17835 : * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17836 : * Py_ssize_t *strides, int ndim,
17837 : * size_t itemsize, void *item) noexcept nogil:
17838 : */
17839 :
17840 : /* function exit code */
17841 0 : }
17842 :
17843 : /* "(tree fragment)":1
17844 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
17845 : * cdef object __pyx_PickleError
17846 : * cdef object __pyx_result
17847 : */
17848 :
17849 : /* Python wrapper */
17850 : static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
17851 : #if CYTHON_METH_FASTCALL
17852 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
17853 : #else
17854 : PyObject *__pyx_args, PyObject *__pyx_kwds
17855 : #endif
17856 : ); /*proto*/
17857 : static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
17858 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
17859 : #if CYTHON_METH_FASTCALL
17860 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
17861 : #else
17862 : PyObject *__pyx_args, PyObject *__pyx_kwds
17863 : #endif
17864 : ) {
17865 0 : PyObject *__pyx_v___pyx_type = 0;
17866 0 : long __pyx_v___pyx_checksum;
17867 0 : PyObject *__pyx_v___pyx_state = 0;
17868 : #if !CYTHON_METH_FASTCALL
17869 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
17870 : #endif
17871 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
17872 0 : PyObject* values[3] = {0,0,0};
17873 0 : int __pyx_lineno = 0;
17874 0 : const char *__pyx_filename = NULL;
17875 0 : int __pyx_clineno = 0;
17876 0 : PyObject *__pyx_r = 0;
17877 : __Pyx_RefNannyDeclarations
17878 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
17879 : #if !CYTHON_METH_FASTCALL
17880 : #if CYTHON_ASSUME_SAFE_MACROS
17881 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
17882 : #else
17883 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
17884 : #endif
17885 : #endif
17886 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
17887 : {
17888 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
17889 0 : if (__pyx_kwds) {
17890 0 : Py_ssize_t kw_args;
17891 0 : switch (__pyx_nargs) {
17892 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
17893 0 : CYTHON_FALLTHROUGH;
17894 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
17895 0 : CYTHON_FALLTHROUGH;
17896 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
17897 0 : CYTHON_FALLTHROUGH;
17898 0 : case 0: break;
17899 0 : default: goto __pyx_L5_argtuple_error;
17900 : }
17901 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
17902 0 : switch (__pyx_nargs) {
17903 0 : case 0:
17904 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
17905 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
17906 0 : kw_args--;
17907 : }
17908 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
17909 0 : else goto __pyx_L5_argtuple_error;
17910 0 : CYTHON_FALLTHROUGH;
17911 : case 1:
17912 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
17913 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
17914 0 : kw_args--;
17915 : }
17916 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
17917 : else {
17918 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
17919 : }
17920 0 : CYTHON_FALLTHROUGH;
17921 : case 2:
17922 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
17923 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
17924 0 : kw_args--;
17925 : }
17926 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
17927 : else {
17928 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
17929 : }
17930 : }
17931 0 : if (unlikely(kw_args > 0)) {
17932 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
17933 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
17934 : }
17935 0 : } else if (unlikely(__pyx_nargs != 3)) {
17936 0 : goto __pyx_L5_argtuple_error;
17937 : } else {
17938 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
17939 0 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
17940 0 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
17941 : }
17942 0 : __pyx_v___pyx_type = values[0];
17943 0 : __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
17944 0 : __pyx_v___pyx_state = values[2];
17945 : }
17946 0 : goto __pyx_L6_skip;
17947 0 : __pyx_L5_argtuple_error:;
17948 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error)
17949 0 : __pyx_L6_skip:;
17950 0 : goto __pyx_L4_argument_unpacking_done;
17951 0 : __pyx_L3_error:;
17952 : {
17953 0 : Py_ssize_t __pyx_temp;
17954 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
17955 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
17956 : }
17957 : }
17958 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
17959 0 : __Pyx_RefNannyFinishContext();
17960 0 : return NULL;
17961 0 : __pyx_L4_argument_unpacking_done:;
17962 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
17963 :
17964 : /* function exit code */
17965 : {
17966 0 : Py_ssize_t __pyx_temp;
17967 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
17968 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
17969 : }
17970 : }
17971 : __Pyx_RefNannyFinishContext();
17972 : return __pyx_r;
17973 : }
17974 :
17975 0 : static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
17976 0 : PyObject *__pyx_v___pyx_PickleError = 0;
17977 0 : PyObject *__pyx_v___pyx_result = 0;
17978 0 : PyObject *__pyx_r = NULL;
17979 : __Pyx_RefNannyDeclarations
17980 0 : PyObject *__pyx_t_1 = NULL;
17981 0 : int __pyx_t_2;
17982 0 : PyObject *__pyx_t_3 = NULL;
17983 0 : PyObject *__pyx_t_4 = NULL;
17984 0 : unsigned int __pyx_t_5;
17985 0 : int __pyx_lineno = 0;
17986 0 : const char *__pyx_filename = NULL;
17987 0 : int __pyx_clineno = 0;
17988 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 1);
17989 :
17990 : /* "(tree fragment)":4
17991 : * cdef object __pyx_PickleError
17992 : * cdef object __pyx_result
17993 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
17994 : * from pickle import PickleError as __pyx_PickleError
17995 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
17996 : */
17997 0 : __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17998 0 : __Pyx_GOTREF(__pyx_t_1);
17999 0 : __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__8, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error)
18000 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18001 0 : if (__pyx_t_2) {
18002 :
18003 : /* "(tree fragment)":5
18004 : * cdef object __pyx_result
18005 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
18006 : * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
18007 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18008 : * __pyx_result = Enum.__new__(__pyx_type)
18009 : */
18010 0 : __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
18011 0 : __Pyx_GOTREF(__pyx_t_1);
18012 0 : __Pyx_INCREF(__pyx_n_s_PickleError);
18013 0 : __Pyx_GIVEREF(__pyx_n_s_PickleError);
18014 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error);
18015 0 : __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
18016 0 : __Pyx_GOTREF(__pyx_t_3);
18017 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18018 0 : __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
18019 0 : __Pyx_GOTREF(__pyx_t_1);
18020 0 : __Pyx_INCREF(__pyx_t_1);
18021 0 : __pyx_v___pyx_PickleError = __pyx_t_1;
18022 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18023 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18024 :
18025 : /* "(tree fragment)":6
18026 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
18027 : * from pickle import PickleError as __pyx_PickleError
18028 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum # <<<<<<<<<<<<<<
18029 : * __pyx_result = Enum.__new__(__pyx_type)
18030 : * if __pyx_state is not None:
18031 : */
18032 0 : __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
18033 0 : __Pyx_GOTREF(__pyx_t_3);
18034 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
18035 0 : __Pyx_GOTREF(__pyx_t_1);
18036 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18037 0 : __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
18038 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18039 0 : __PYX_ERR(1, 6, __pyx_L1_error)
18040 :
18041 : /* "(tree fragment)":4
18042 : * cdef object __pyx_PickleError
18043 : * cdef object __pyx_result
18044 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
18045 : * from pickle import PickleError as __pyx_PickleError
18046 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18047 : */
18048 : }
18049 :
18050 : /* "(tree fragment)":7
18051 : * from pickle import PickleError as __pyx_PickleError
18052 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18053 : * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
18054 : * if __pyx_state is not None:
18055 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18056 : */
18057 0 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
18058 0 : __Pyx_GOTREF(__pyx_t_3);
18059 0 : __pyx_t_4 = NULL;
18060 0 : __pyx_t_5 = 0;
18061 : #if CYTHON_UNPACK_METHODS
18062 0 : if (likely(PyMethod_Check(__pyx_t_3))) {
18063 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
18064 0 : if (likely(__pyx_t_4)) {
18065 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
18066 0 : __Pyx_INCREF(__pyx_t_4);
18067 0 : __Pyx_INCREF(function);
18068 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
18069 : __pyx_t_5 = 1;
18070 : }
18071 : }
18072 : #endif
18073 : {
18074 0 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
18075 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
18076 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18077 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
18078 0 : __Pyx_GOTREF(__pyx_t_1);
18079 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18080 : }
18081 0 : __pyx_v___pyx_result = __pyx_t_1;
18082 0 : __pyx_t_1 = 0;
18083 :
18084 : /* "(tree fragment)":8
18085 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18086 : * __pyx_result = Enum.__new__(__pyx_type)
18087 : * if __pyx_state is not None: # <<<<<<<<<<<<<<
18088 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18089 : * return __pyx_result
18090 : */
18091 0 : __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
18092 0 : if (__pyx_t_2) {
18093 :
18094 : /* "(tree fragment)":9
18095 : * __pyx_result = Enum.__new__(__pyx_type)
18096 : * if __pyx_state is not None:
18097 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
18098 : * return __pyx_result
18099 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18100 : */
18101 0 : if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error)
18102 0 : __pyx_t_1 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
18103 0 : __Pyx_GOTREF(__pyx_t_1);
18104 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18105 :
18106 : /* "(tree fragment)":8
18107 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18108 : * __pyx_result = Enum.__new__(__pyx_type)
18109 : * if __pyx_state is not None: # <<<<<<<<<<<<<<
18110 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18111 : * return __pyx_result
18112 : */
18113 : }
18114 :
18115 : /* "(tree fragment)":10
18116 : * if __pyx_state is not None:
18117 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18118 : * return __pyx_result # <<<<<<<<<<<<<<
18119 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18120 : * __pyx_result.name = __pyx_state[0]
18121 : */
18122 0 : __Pyx_XDECREF(__pyx_r);
18123 0 : __Pyx_INCREF(__pyx_v___pyx_result);
18124 0 : __pyx_r = __pyx_v___pyx_result;
18125 0 : goto __pyx_L0;
18126 :
18127 : /* "(tree fragment)":1
18128 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
18129 : * cdef object __pyx_PickleError
18130 : * cdef object __pyx_result
18131 : */
18132 :
18133 : /* function exit code */
18134 0 : __pyx_L1_error:;
18135 0 : __Pyx_XDECREF(__pyx_t_1);
18136 0 : __Pyx_XDECREF(__pyx_t_3);
18137 0 : __Pyx_XDECREF(__pyx_t_4);
18138 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18139 0 : __pyx_r = NULL;
18140 0 : __pyx_L0:;
18141 0 : __Pyx_XDECREF(__pyx_v___pyx_PickleError);
18142 0 : __Pyx_XDECREF(__pyx_v___pyx_result);
18143 0 : __Pyx_XGIVEREF(__pyx_r);
18144 0 : __Pyx_RefNannyFinishContext();
18145 0 : return __pyx_r;
18146 : }
18147 :
18148 : /* "(tree fragment)":11
18149 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18150 : * return __pyx_result
18151 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
18152 : * __pyx_result.name = __pyx_state[0]
18153 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18154 : */
18155 :
18156 0 : static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18157 0 : PyObject *__pyx_r = NULL;
18158 : __Pyx_RefNannyDeclarations
18159 0 : PyObject *__pyx_t_1 = NULL;
18160 0 : int __pyx_t_2;
18161 0 : Py_ssize_t __pyx_t_3;
18162 0 : int __pyx_t_4;
18163 0 : PyObject *__pyx_t_5 = NULL;
18164 0 : PyObject *__pyx_t_6 = NULL;
18165 0 : PyObject *__pyx_t_7 = NULL;
18166 0 : unsigned int __pyx_t_8;
18167 0 : int __pyx_lineno = 0;
18168 0 : const char *__pyx_filename = NULL;
18169 0 : int __pyx_clineno = 0;
18170 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 1);
18171 :
18172 : /* "(tree fragment)":12
18173 : * return __pyx_result
18174 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18175 : * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
18176 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18177 : * __pyx_result.__dict__.update(__pyx_state[1])
18178 : */
18179 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
18180 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18181 0 : __PYX_ERR(1, 12, __pyx_L1_error)
18182 : }
18183 0 : __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18184 0 : __Pyx_GOTREF(__pyx_t_1);
18185 0 : __Pyx_GIVEREF(__pyx_t_1);
18186 0 : __Pyx_GOTREF(__pyx_v___pyx_result->name);
18187 0 : __Pyx_DECREF(__pyx_v___pyx_result->name);
18188 0 : __pyx_v___pyx_result->name = __pyx_t_1;
18189 0 : __pyx_t_1 = 0;
18190 :
18191 : /* "(tree fragment)":13
18192 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18193 : * __pyx_result.name = __pyx_state[0]
18194 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
18195 : * __pyx_result.__dict__.update(__pyx_state[1])
18196 : */
18197 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
18198 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
18199 : __PYX_ERR(1, 13, __pyx_L1_error)
18200 : }
18201 0 : __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18202 0 : __pyx_t_4 = (__pyx_t_3 > 1);
18203 0 : if (__pyx_t_4) {
18204 0 : } else {
18205 0 : __pyx_t_2 = __pyx_t_4;
18206 0 : goto __pyx_L4_bool_binop_done;
18207 : }
18208 0 : __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18209 : __pyx_t_2 = __pyx_t_4;
18210 0 : __pyx_L4_bool_binop_done:;
18211 0 : if (__pyx_t_2) {
18212 :
18213 : /* "(tree fragment)":14
18214 : * __pyx_result.name = __pyx_state[0]
18215 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18216 : * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
18217 : */
18218 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
18219 0 : __Pyx_GOTREF(__pyx_t_5);
18220 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
18221 0 : __Pyx_GOTREF(__pyx_t_6);
18222 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18223 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
18224 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18225 : __PYX_ERR(1, 14, __pyx_L1_error)
18226 : }
18227 0 : __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
18228 0 : __Pyx_GOTREF(__pyx_t_5);
18229 0 : __pyx_t_7 = NULL;
18230 0 : __pyx_t_8 = 0;
18231 : #if CYTHON_UNPACK_METHODS
18232 0 : if (likely(PyMethod_Check(__pyx_t_6))) {
18233 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
18234 0 : if (likely(__pyx_t_7)) {
18235 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
18236 0 : __Pyx_INCREF(__pyx_t_7);
18237 0 : __Pyx_INCREF(function);
18238 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
18239 : __pyx_t_8 = 1;
18240 : }
18241 : }
18242 : #endif
18243 : {
18244 0 : PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
18245 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
18246 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
18247 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18248 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
18249 0 : __Pyx_GOTREF(__pyx_t_1);
18250 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18251 : }
18252 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18253 :
18254 : /* "(tree fragment)":13
18255 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18256 : * __pyx_result.name = __pyx_state[0]
18257 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
18258 : * __pyx_result.__dict__.update(__pyx_state[1])
18259 : */
18260 : }
18261 :
18262 : /* "(tree fragment)":11
18263 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18264 : * return __pyx_result
18265 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
18266 : * __pyx_result.name = __pyx_state[0]
18267 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18268 : */
18269 :
18270 : /* function exit code */
18271 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18272 0 : goto __pyx_L0;
18273 0 : __pyx_L1_error:;
18274 0 : __Pyx_XDECREF(__pyx_t_1);
18275 0 : __Pyx_XDECREF(__pyx_t_5);
18276 0 : __Pyx_XDECREF(__pyx_t_6);
18277 0 : __Pyx_XDECREF(__pyx_t_7);
18278 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
18279 0 : __pyx_r = 0;
18280 0 : __pyx_L0:;
18281 0 : __Pyx_XGIVEREF(__pyx_r);
18282 0 : __Pyx_RefNannyFinishContext();
18283 0 : return __pyx_r;
18284 : }
18285 :
18286 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
18287 : *
18288 : * @property
18289 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
18290 : * return PyDataType_ELSIZE(self)
18291 : *
18292 : */
18293 :
18294 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) {
18295 : npy_intp __pyx_r;
18296 :
18297 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":287
18298 : * @property
18299 : * cdef inline npy_intp itemsize(self) noexcept nogil:
18300 : * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
18301 : *
18302 : * @property
18303 : */
18304 : __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
18305 : goto __pyx_L0;
18306 :
18307 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
18308 : *
18309 : * @property
18310 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
18311 : * return PyDataType_ELSIZE(self)
18312 : *
18313 : */
18314 :
18315 : /* function exit code */
18316 : __pyx_L0:;
18317 : return __pyx_r;
18318 : }
18319 :
18320 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
18321 : *
18322 : * @property
18323 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
18324 : * return PyDataType_ALIGNMENT(self)
18325 : *
18326 : */
18327 :
18328 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) {
18329 : npy_intp __pyx_r;
18330 :
18331 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":291
18332 : * @property
18333 : * cdef inline npy_intp alignment(self) noexcept nogil:
18334 : * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
18335 : *
18336 : * # Use fields/names with care as they may be NULL. You must check
18337 : */
18338 : __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
18339 : goto __pyx_L0;
18340 :
18341 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
18342 : *
18343 : * @property
18344 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
18345 : * return PyDataType_ALIGNMENT(self)
18346 : *
18347 : */
18348 :
18349 : /* function exit code */
18350 : __pyx_L0:;
18351 : return __pyx_r;
18352 : }
18353 :
18354 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
18355 : * # for this using PyDataType_HASFIELDS.
18356 : * @property
18357 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
18358 : * return <object>PyDataType_FIELDS(self)
18359 : *
18360 : */
18361 :
18362 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self) {
18363 : PyObject *__pyx_r = NULL;
18364 : __Pyx_RefNannyDeclarations
18365 : PyObject *__pyx_t_1;
18366 : __Pyx_RefNannySetupContext("fields", 1);
18367 :
18368 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":297
18369 : * @property
18370 : * cdef inline object fields(self):
18371 : * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
18372 : *
18373 : * @property
18374 : */
18375 : __Pyx_XDECREF(__pyx_r);
18376 : __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
18377 : __Pyx_INCREF(((PyObject *)__pyx_t_1));
18378 : __pyx_r = ((PyObject *)__pyx_t_1);
18379 : goto __pyx_L0;
18380 :
18381 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
18382 : * # for this using PyDataType_HASFIELDS.
18383 : * @property
18384 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
18385 : * return <object>PyDataType_FIELDS(self)
18386 : *
18387 : */
18388 :
18389 : /* function exit code */
18390 : __pyx_L0:;
18391 : __Pyx_XGIVEREF(__pyx_r);
18392 : __Pyx_RefNannyFinishContext();
18393 : return __pyx_r;
18394 : }
18395 :
18396 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
18397 : *
18398 : * @property
18399 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
18400 : * return <tuple>PyDataType_NAMES(self)
18401 : *
18402 : */
18403 :
18404 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self) {
18405 : PyObject *__pyx_r = NULL;
18406 : __Pyx_RefNannyDeclarations
18407 : PyObject *__pyx_t_1;
18408 : __Pyx_RefNannySetupContext("names", 1);
18409 :
18410 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":301
18411 : * @property
18412 : * cdef inline tuple names(self):
18413 : * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
18414 : *
18415 : * # Use PyDataType_HASSUBARRAY to test whether this field is
18416 : */
18417 : __Pyx_XDECREF(__pyx_r);
18418 : __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
18419 : __Pyx_INCREF(((PyObject*)__pyx_t_1));
18420 : __pyx_r = ((PyObject*)__pyx_t_1);
18421 : goto __pyx_L0;
18422 :
18423 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
18424 : *
18425 : * @property
18426 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
18427 : * return <tuple>PyDataType_NAMES(self)
18428 : *
18429 : */
18430 :
18431 : /* function exit code */
18432 : __pyx_L0:;
18433 : __Pyx_XGIVEREF(__pyx_r);
18434 : __Pyx_RefNannyFinishContext();
18435 : return __pyx_r;
18436 : }
18437 :
18438 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
18439 : * # this field via the inline helper method PyDataType_SHAPE.
18440 : * @property
18441 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
18442 : * return PyDataType_SUBARRAY(self)
18443 : *
18444 : */
18445 :
18446 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) {
18447 : PyArray_ArrayDescr *__pyx_r;
18448 :
18449 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":308
18450 : * @property
18451 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
18452 : * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
18453 : *
18454 : * @property
18455 : */
18456 : __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
18457 : goto __pyx_L0;
18458 :
18459 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
18460 : * # this field via the inline helper method PyDataType_SHAPE.
18461 : * @property
18462 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
18463 : * return PyDataType_SUBARRAY(self)
18464 : *
18465 : */
18466 :
18467 : /* function exit code */
18468 : __pyx_L0:;
18469 : return __pyx_r;
18470 : }
18471 :
18472 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
18473 : *
18474 : * @property
18475 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
18476 : * """The data types flags."""
18477 : * return PyDataType_FLAGS(self)
18478 : */
18479 :
18480 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) {
18481 : npy_uint64 __pyx_r;
18482 :
18483 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":313
18484 : * cdef inline npy_uint64 flags(self) noexcept nogil:
18485 : * """The data types flags."""
18486 : * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
18487 : *
18488 : *
18489 : */
18490 : __pyx_r = PyDataType_FLAGS(__pyx_v_self);
18491 : goto __pyx_L0;
18492 :
18493 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
18494 : *
18495 : * @property
18496 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
18497 : * """The data types flags."""
18498 : * return PyDataType_FLAGS(self)
18499 : */
18500 :
18501 : /* function exit code */
18502 : __pyx_L0:;
18503 : return __pyx_r;
18504 : }
18505 :
18506 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
18507 : *
18508 : * @property
18509 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
18510 : * """The number of arrays that need to be broadcast to the same shape."""
18511 : * return PyArray_MultiIter_NUMITER(self)
18512 : */
18513 :
18514 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) {
18515 : int __pyx_r;
18516 :
18517 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":325
18518 : * cdef inline int numiter(self) noexcept nogil:
18519 : * """The number of arrays that need to be broadcast to the same shape."""
18520 : * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
18521 : *
18522 : * @property
18523 : */
18524 : __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
18525 : goto __pyx_L0;
18526 :
18527 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
18528 : *
18529 : * @property
18530 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
18531 : * """The number of arrays that need to be broadcast to the same shape."""
18532 : * return PyArray_MultiIter_NUMITER(self)
18533 : */
18534 :
18535 : /* function exit code */
18536 : __pyx_L0:;
18537 : return __pyx_r;
18538 : }
18539 :
18540 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
18541 : *
18542 : * @property
18543 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
18544 : * """The total broadcasted size."""
18545 : * return PyArray_MultiIter_SIZE(self)
18546 : */
18547 :
18548 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) {
18549 : npy_intp __pyx_r;
18550 :
18551 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":330
18552 : * cdef inline npy_intp size(self) noexcept nogil:
18553 : * """The total broadcasted size."""
18554 : * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
18555 : *
18556 : * @property
18557 : */
18558 : __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
18559 : goto __pyx_L0;
18560 :
18561 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
18562 : *
18563 : * @property
18564 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
18565 : * """The total broadcasted size."""
18566 : * return PyArray_MultiIter_SIZE(self)
18567 : */
18568 :
18569 : /* function exit code */
18570 : __pyx_L0:;
18571 : return __pyx_r;
18572 : }
18573 :
18574 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
18575 : *
18576 : * @property
18577 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
18578 : * """The current (1-d) index into the broadcasted result."""
18579 : * return PyArray_MultiIter_INDEX(self)
18580 : */
18581 :
18582 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) {
18583 : npy_intp __pyx_r;
18584 :
18585 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":335
18586 : * cdef inline npy_intp index(self) noexcept nogil:
18587 : * """The current (1-d) index into the broadcasted result."""
18588 : * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
18589 : *
18590 : * @property
18591 : */
18592 : __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
18593 : goto __pyx_L0;
18594 :
18595 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
18596 : *
18597 : * @property
18598 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
18599 : * """The current (1-d) index into the broadcasted result."""
18600 : * return PyArray_MultiIter_INDEX(self)
18601 : */
18602 :
18603 : /* function exit code */
18604 : __pyx_L0:;
18605 : return __pyx_r;
18606 : }
18607 :
18608 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
18609 : *
18610 : * @property
18611 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
18612 : * """The number of dimensions in the broadcasted result."""
18613 : * return PyArray_MultiIter_NDIM(self)
18614 : */
18615 :
18616 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) {
18617 : int __pyx_r;
18618 :
18619 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":340
18620 : * cdef inline int nd(self) noexcept nogil:
18621 : * """The number of dimensions in the broadcasted result."""
18622 : * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
18623 : *
18624 : * @property
18625 : */
18626 : __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
18627 : goto __pyx_L0;
18628 :
18629 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
18630 : *
18631 : * @property
18632 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
18633 : * """The number of dimensions in the broadcasted result."""
18634 : * return PyArray_MultiIter_NDIM(self)
18635 : */
18636 :
18637 : /* function exit code */
18638 : __pyx_L0:;
18639 : return __pyx_r;
18640 : }
18641 :
18642 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
18643 : *
18644 : * @property
18645 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
18646 : * """The shape of the broadcasted result."""
18647 : * return PyArray_MultiIter_DIMS(self)
18648 : */
18649 :
18650 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) {
18651 : npy_intp *__pyx_r;
18652 :
18653 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":345
18654 : * cdef inline npy_intp* dimensions(self) noexcept nogil:
18655 : * """The shape of the broadcasted result."""
18656 : * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
18657 : *
18658 : * @property
18659 : */
18660 : __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
18661 : goto __pyx_L0;
18662 :
18663 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
18664 : *
18665 : * @property
18666 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
18667 : * """The shape of the broadcasted result."""
18668 : * return PyArray_MultiIter_DIMS(self)
18669 : */
18670 :
18671 : /* function exit code */
18672 : __pyx_L0:;
18673 : return __pyx_r;
18674 : }
18675 :
18676 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
18677 : *
18678 : * @property
18679 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
18680 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
18681 : * On return, the iterators are adjusted for broadcasting."""
18682 : */
18683 :
18684 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) {
18685 : void **__pyx_r;
18686 :
18687 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":351
18688 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
18689 : * On return, the iterators are adjusted for broadcasting."""
18690 : * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
18691 : *
18692 : *
18693 : */
18694 : __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
18695 : goto __pyx_L0;
18696 :
18697 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
18698 : *
18699 : * @property
18700 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
18701 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
18702 : * On return, the iterators are adjusted for broadcasting."""
18703 : */
18704 :
18705 : /* function exit code */
18706 : __pyx_L0:;
18707 : return __pyx_r;
18708 : }
18709 :
18710 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
18711 : *
18712 : * @property
18713 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
18714 : * """Returns a borrowed reference to the object owning the data/memory.
18715 : * """
18716 : */
18717 :
18718 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
18719 : PyObject *__pyx_r;
18720 :
18721 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":369
18722 : * """Returns a borrowed reference to the object owning the data/memory.
18723 : * """
18724 : * return PyArray_BASE(self) # <<<<<<<<<<<<<<
18725 : *
18726 : * @property
18727 : */
18728 : __pyx_r = PyArray_BASE(__pyx_v_self);
18729 : goto __pyx_L0;
18730 :
18731 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
18732 : *
18733 : * @property
18734 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
18735 : * """Returns a borrowed reference to the object owning the data/memory.
18736 : * """
18737 : */
18738 :
18739 : /* function exit code */
18740 : __pyx_L0:;
18741 : return __pyx_r;
18742 : }
18743 :
18744 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
18745 : *
18746 : * @property
18747 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
18748 : * """Returns an owned reference to the dtype of the array.
18749 : * """
18750 : */
18751 :
18752 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) {
18753 : PyArray_Descr *__pyx_r = NULL;
18754 : __Pyx_RefNannyDeclarations
18755 : PyArray_Descr *__pyx_t_1;
18756 : __Pyx_RefNannySetupContext("descr", 1);
18757 :
18758 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":375
18759 : * """Returns an owned reference to the dtype of the array.
18760 : * """
18761 : * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
18762 : *
18763 : * @property
18764 : */
18765 : __Pyx_XDECREF((PyObject *)__pyx_r);
18766 : __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
18767 : __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
18768 : __pyx_r = ((PyArray_Descr *)__pyx_t_1);
18769 : goto __pyx_L0;
18770 :
18771 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
18772 : *
18773 : * @property
18774 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
18775 : * """Returns an owned reference to the dtype of the array.
18776 : * """
18777 : */
18778 :
18779 : /* function exit code */
18780 : __pyx_L0:;
18781 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
18782 : __Pyx_RefNannyFinishContext();
18783 : return __pyx_r;
18784 : }
18785 :
18786 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
18787 : *
18788 : * @property
18789 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
18790 : * """Returns the number of dimensions in the array.
18791 : * """
18792 : */
18793 :
18794 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
18795 : int __pyx_r;
18796 :
18797 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":381
18798 : * """Returns the number of dimensions in the array.
18799 : * """
18800 : * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
18801 : *
18802 : * @property
18803 : */
18804 : __pyx_r = PyArray_NDIM(__pyx_v_self);
18805 : goto __pyx_L0;
18806 :
18807 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
18808 : *
18809 : * @property
18810 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
18811 : * """Returns the number of dimensions in the array.
18812 : * """
18813 : */
18814 :
18815 : /* function exit code */
18816 : __pyx_L0:;
18817 : return __pyx_r;
18818 : }
18819 :
18820 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
18821 : *
18822 : * @property
18823 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
18824 : * """Returns a pointer to the dimensions/shape of the array.
18825 : * The number of elements matches the number of dimensions of the array (ndim).
18826 : */
18827 :
18828 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
18829 : npy_intp *__pyx_r;
18830 :
18831 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":389
18832 : * Can return NULL for 0-dimensional arrays.
18833 : * """
18834 : * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
18835 : *
18836 : * @property
18837 : */
18838 : __pyx_r = PyArray_DIMS(__pyx_v_self);
18839 : goto __pyx_L0;
18840 :
18841 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
18842 : *
18843 : * @property
18844 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
18845 : * """Returns a pointer to the dimensions/shape of the array.
18846 : * The number of elements matches the number of dimensions of the array (ndim).
18847 : */
18848 :
18849 : /* function exit code */
18850 : __pyx_L0:;
18851 : return __pyx_r;
18852 : }
18853 :
18854 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
18855 : *
18856 : * @property
18857 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
18858 : * """Returns a pointer to the strides of the array.
18859 : * The number of elements matches the number of dimensions of the array (ndim).
18860 : */
18861 :
18862 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
18863 : npy_intp *__pyx_r;
18864 :
18865 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":396
18866 : * The number of elements matches the number of dimensions of the array (ndim).
18867 : * """
18868 : * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
18869 : *
18870 : * @property
18871 : */
18872 : __pyx_r = PyArray_STRIDES(__pyx_v_self);
18873 : goto __pyx_L0;
18874 :
18875 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
18876 : *
18877 : * @property
18878 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
18879 : * """Returns a pointer to the strides of the array.
18880 : * The number of elements matches the number of dimensions of the array (ndim).
18881 : */
18882 :
18883 : /* function exit code */
18884 : __pyx_L0:;
18885 : return __pyx_r;
18886 : }
18887 :
18888 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
18889 : *
18890 : * @property
18891 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
18892 : * """Returns the total size (in number of elements) of the array.
18893 : * """
18894 : */
18895 :
18896 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
18897 : npy_intp __pyx_r;
18898 :
18899 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":402
18900 : * """Returns the total size (in number of elements) of the array.
18901 : * """
18902 : * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
18903 : *
18904 : * @property
18905 : */
18906 : __pyx_r = PyArray_SIZE(__pyx_v_self);
18907 : goto __pyx_L0;
18908 :
18909 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
18910 : *
18911 : * @property
18912 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
18913 : * """Returns the total size (in number of elements) of the array.
18914 : * """
18915 : */
18916 :
18917 : /* function exit code */
18918 : __pyx_L0:;
18919 : return __pyx_r;
18920 : }
18921 :
18922 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
18923 : *
18924 : * @property
18925 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
18926 : * """The pointer to the data buffer as a char*.
18927 : * This is provided for legacy reasons to avoid direct struct field access.
18928 : */
18929 :
18930 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
18931 : char *__pyx_r;
18932 :
18933 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":411
18934 : * of `PyArray_DATA()` instead, which returns a 'void*'.
18935 : * """
18936 : * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
18937 : *
18938 : *
18939 : */
18940 : __pyx_r = PyArray_BYTES(__pyx_v_self);
18941 : goto __pyx_L0;
18942 :
18943 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
18944 : *
18945 : * @property
18946 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
18947 : * """The pointer to the data buffer as a char*.
18948 : * This is provided for legacy reasons to avoid direct struct field access.
18949 : */
18950 :
18951 : /* function exit code */
18952 : __pyx_L0:;
18953 : return __pyx_r;
18954 : }
18955 :
18956 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
18957 : * ctypedef long double complex clongdouble_t
18958 : *
18959 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
18960 : * return PyArray_MultiIterNew(1, <void*>a)
18961 : *
18962 : */
18963 :
18964 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
18965 : PyObject *__pyx_r = NULL;
18966 : __Pyx_RefNannyDeclarations
18967 : PyObject *__pyx_t_1 = NULL;
18968 : int __pyx_lineno = 0;
18969 : const char *__pyx_filename = NULL;
18970 : int __pyx_clineno = 0;
18971 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);
18972 :
18973 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":807
18974 : *
18975 : * cdef inline object PyArray_MultiIterNew1(a):
18976 : * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
18977 : *
18978 : * cdef inline object PyArray_MultiIterNew2(a, b):
18979 : */
18980 : __Pyx_XDECREF(__pyx_r);
18981 : __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 807, __pyx_L1_error)
18982 : __Pyx_GOTREF(__pyx_t_1);
18983 : __pyx_r = __pyx_t_1;
18984 : __pyx_t_1 = 0;
18985 : goto __pyx_L0;
18986 :
18987 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
18988 : * ctypedef long double complex clongdouble_t
18989 : *
18990 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
18991 : * return PyArray_MultiIterNew(1, <void*>a)
18992 : *
18993 : */
18994 :
18995 : /* function exit code */
18996 : __pyx_L1_error:;
18997 : __Pyx_XDECREF(__pyx_t_1);
18998 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
18999 : __pyx_r = 0;
19000 : __pyx_L0:;
19001 : __Pyx_XGIVEREF(__pyx_r);
19002 : __Pyx_RefNannyFinishContext();
19003 : return __pyx_r;
19004 : }
19005 :
19006 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
19007 : * return PyArray_MultiIterNew(1, <void*>a)
19008 : *
19009 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19010 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19011 : *
19012 : */
19013 :
19014 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
19015 : PyObject *__pyx_r = NULL;
19016 : __Pyx_RefNannyDeclarations
19017 : PyObject *__pyx_t_1 = NULL;
19018 : int __pyx_lineno = 0;
19019 : const char *__pyx_filename = NULL;
19020 : int __pyx_clineno = 0;
19021 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);
19022 :
19023 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":810
19024 : *
19025 : * cdef inline object PyArray_MultiIterNew2(a, b):
19026 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
19027 : *
19028 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
19029 : */
19030 : __Pyx_XDECREF(__pyx_r);
19031 : __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 810, __pyx_L1_error)
19032 : __Pyx_GOTREF(__pyx_t_1);
19033 : __pyx_r = __pyx_t_1;
19034 : __pyx_t_1 = 0;
19035 : goto __pyx_L0;
19036 :
19037 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
19038 : * return PyArray_MultiIterNew(1, <void*>a)
19039 : *
19040 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19041 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19042 : *
19043 : */
19044 :
19045 : /* function exit code */
19046 : __pyx_L1_error:;
19047 : __Pyx_XDECREF(__pyx_t_1);
19048 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19049 : __pyx_r = 0;
19050 : __pyx_L0:;
19051 : __Pyx_XGIVEREF(__pyx_r);
19052 : __Pyx_RefNannyFinishContext();
19053 : return __pyx_r;
19054 : }
19055 :
19056 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
19057 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19058 : *
19059 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19060 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19061 : *
19062 : */
19063 :
19064 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
19065 : PyObject *__pyx_r = NULL;
19066 : __Pyx_RefNannyDeclarations
19067 : PyObject *__pyx_t_1 = NULL;
19068 : int __pyx_lineno = 0;
19069 : const char *__pyx_filename = NULL;
19070 : int __pyx_clineno = 0;
19071 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);
19072 :
19073 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":813
19074 : *
19075 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
19076 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
19077 : *
19078 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19079 : */
19080 : __Pyx_XDECREF(__pyx_r);
19081 : __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 813, __pyx_L1_error)
19082 : __Pyx_GOTREF(__pyx_t_1);
19083 : __pyx_r = __pyx_t_1;
19084 : __pyx_t_1 = 0;
19085 : goto __pyx_L0;
19086 :
19087 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
19088 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19089 : *
19090 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19091 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19092 : *
19093 : */
19094 :
19095 : /* function exit code */
19096 : __pyx_L1_error:;
19097 : __Pyx_XDECREF(__pyx_t_1);
19098 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19099 : __pyx_r = 0;
19100 : __pyx_L0:;
19101 : __Pyx_XGIVEREF(__pyx_r);
19102 : __Pyx_RefNannyFinishContext();
19103 : return __pyx_r;
19104 : }
19105 :
19106 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
19107 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19108 : *
19109 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19110 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19111 : *
19112 : */
19113 :
19114 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
19115 : PyObject *__pyx_r = NULL;
19116 : __Pyx_RefNannyDeclarations
19117 : PyObject *__pyx_t_1 = NULL;
19118 : int __pyx_lineno = 0;
19119 : const char *__pyx_filename = NULL;
19120 : int __pyx_clineno = 0;
19121 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);
19122 :
19123 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":816
19124 : *
19125 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19126 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
19127 : *
19128 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19129 : */
19130 : __Pyx_XDECREF(__pyx_r);
19131 : __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 816, __pyx_L1_error)
19132 : __Pyx_GOTREF(__pyx_t_1);
19133 : __pyx_r = __pyx_t_1;
19134 : __pyx_t_1 = 0;
19135 : goto __pyx_L0;
19136 :
19137 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
19138 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19139 : *
19140 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19141 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19142 : *
19143 : */
19144 :
19145 : /* function exit code */
19146 : __pyx_L1_error:;
19147 : __Pyx_XDECREF(__pyx_t_1);
19148 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19149 : __pyx_r = 0;
19150 : __pyx_L0:;
19151 : __Pyx_XGIVEREF(__pyx_r);
19152 : __Pyx_RefNannyFinishContext();
19153 : return __pyx_r;
19154 : }
19155 :
19156 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
19157 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19158 : *
19159 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
19160 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19161 : *
19162 : */
19163 :
19164 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
19165 : PyObject *__pyx_r = NULL;
19166 : __Pyx_RefNannyDeclarations
19167 : PyObject *__pyx_t_1 = NULL;
19168 : int __pyx_lineno = 0;
19169 : const char *__pyx_filename = NULL;
19170 : int __pyx_clineno = 0;
19171 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);
19172 :
19173 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":819
19174 : *
19175 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19176 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
19177 : *
19178 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19179 : */
19180 : __Pyx_XDECREF(__pyx_r);
19181 : __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 819, __pyx_L1_error)
19182 : __Pyx_GOTREF(__pyx_t_1);
19183 : __pyx_r = __pyx_t_1;
19184 : __pyx_t_1 = 0;
19185 : goto __pyx_L0;
19186 :
19187 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
19188 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19189 : *
19190 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
19191 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19192 : *
19193 : */
19194 :
19195 : /* function exit code */
19196 : __pyx_L1_error:;
19197 : __Pyx_XDECREF(__pyx_t_1);
19198 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
19199 : __pyx_r = 0;
19200 : __pyx_L0:;
19201 : __Pyx_XGIVEREF(__pyx_r);
19202 : __Pyx_RefNannyFinishContext();
19203 : return __pyx_r;
19204 : }
19205 :
19206 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
19207 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19208 : *
19209 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
19210 : * if PyDataType_HASSUBARRAY(d):
19211 : * return <tuple>d.subarray.shape
19212 : */
19213 :
19214 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
19215 : PyObject *__pyx_r = NULL;
19216 : __Pyx_RefNannyDeclarations
19217 : int __pyx_t_1;
19218 : PyObject *__pyx_t_2;
19219 : __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);
19220 :
19221 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
19222 : *
19223 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19224 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
19225 : * return <tuple>d.subarray.shape
19226 : * else:
19227 : */
19228 : __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
19229 : if (__pyx_t_1) {
19230 :
19231 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":823
19232 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19233 : * if PyDataType_HASSUBARRAY(d):
19234 : * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
19235 : * else:
19236 : * return ()
19237 : */
19238 : __Pyx_XDECREF(__pyx_r);
19239 : __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray_subarray(__pyx_v_d)->shape;
19240 : __Pyx_INCREF(((PyObject*)__pyx_t_2));
19241 : __pyx_r = ((PyObject*)__pyx_t_2);
19242 : goto __pyx_L0;
19243 :
19244 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
19245 : *
19246 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19247 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
19248 : * return <tuple>d.subarray.shape
19249 : * else:
19250 : */
19251 : }
19252 :
19253 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":825
19254 : * return <tuple>d.subarray.shape
19255 : * else:
19256 : * return () # <<<<<<<<<<<<<<
19257 : *
19258 : *
19259 : */
19260 : /*else*/ {
19261 : __Pyx_XDECREF(__pyx_r);
19262 : __Pyx_INCREF(__pyx_empty_tuple);
19263 : __pyx_r = __pyx_empty_tuple;
19264 : goto __pyx_L0;
19265 : }
19266 :
19267 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
19268 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19269 : *
19270 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
19271 : * if PyDataType_HASSUBARRAY(d):
19272 : * return <tuple>d.subarray.shape
19273 : */
19274 :
19275 : /* function exit code */
19276 : __pyx_L0:;
19277 : __Pyx_XGIVEREF(__pyx_r);
19278 : __Pyx_RefNannyFinishContext();
19279 : return __pyx_r;
19280 : }
19281 :
19282 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
19283 : * int _import_umath() except -1
19284 : *
19285 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
19286 : * Py_INCREF(base) # important to do this before stealing the reference below!
19287 : * PyArray_SetBaseObject(arr, base)
19288 : */
19289 :
19290 : static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
19291 : int __pyx_t_1;
19292 : int __pyx_lineno = 0;
19293 : const char *__pyx_filename = NULL;
19294 : int __pyx_clineno = 0;
19295 :
19296 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1010
19297 : *
19298 : * cdef inline void set_array_base(ndarray arr, object base) except *:
19299 : * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
19300 : * PyArray_SetBaseObject(arr, base)
19301 : *
19302 : */
19303 : Py_INCREF(__pyx_v_base);
19304 :
19305 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1011
19306 : * cdef inline void set_array_base(ndarray arr, object base) except *:
19307 : * Py_INCREF(base) # important to do this before stealing the reference below!
19308 : * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
19309 : *
19310 : * cdef inline object get_array_base(ndarray arr):
19311 : */
19312 : __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1011, __pyx_L1_error)
19313 :
19314 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
19315 : * int _import_umath() except -1
19316 : *
19317 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
19318 : * Py_INCREF(base) # important to do this before stealing the reference below!
19319 : * PyArray_SetBaseObject(arr, base)
19320 : */
19321 :
19322 : /* function exit code */
19323 : goto __pyx_L0;
19324 : __pyx_L1_error:;
19325 : __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
19326 : __pyx_L0:;
19327 : }
19328 :
19329 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
19330 : * PyArray_SetBaseObject(arr, base)
19331 : *
19332 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
19333 : * base = PyArray_BASE(arr)
19334 : * if base is NULL:
19335 : */
19336 :
19337 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
19338 : PyObject *__pyx_v_base;
19339 : PyObject *__pyx_r = NULL;
19340 : __Pyx_RefNannyDeclarations
19341 : int __pyx_t_1;
19342 : __Pyx_RefNannySetupContext("get_array_base", 1);
19343 :
19344 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1014
19345 : *
19346 : * cdef inline object get_array_base(ndarray arr):
19347 : * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
19348 : * if base is NULL:
19349 : * return None
19350 : */
19351 : __pyx_v_base = PyArray_BASE(__pyx_v_arr);
19352 :
19353 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
19354 : * cdef inline object get_array_base(ndarray arr):
19355 : * base = PyArray_BASE(arr)
19356 : * if base is NULL: # <<<<<<<<<<<<<<
19357 : * return None
19358 : * return <object>base
19359 : */
19360 : __pyx_t_1 = (__pyx_v_base == NULL);
19361 : if (__pyx_t_1) {
19362 :
19363 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1016
19364 : * base = PyArray_BASE(arr)
19365 : * if base is NULL:
19366 : * return None # <<<<<<<<<<<<<<
19367 : * return <object>base
19368 : *
19369 : */
19370 : __Pyx_XDECREF(__pyx_r);
19371 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19372 : goto __pyx_L0;
19373 :
19374 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
19375 : * cdef inline object get_array_base(ndarray arr):
19376 : * base = PyArray_BASE(arr)
19377 : * if base is NULL: # <<<<<<<<<<<<<<
19378 : * return None
19379 : * return <object>base
19380 : */
19381 : }
19382 :
19383 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1017
19384 : * if base is NULL:
19385 : * return None
19386 : * return <object>base # <<<<<<<<<<<<<<
19387 : *
19388 : * # Versions of the import_* functions which are more suitable for
19389 : */
19390 : __Pyx_XDECREF(__pyx_r);
19391 : __Pyx_INCREF(((PyObject *)__pyx_v_base));
19392 : __pyx_r = ((PyObject *)__pyx_v_base);
19393 : goto __pyx_L0;
19394 :
19395 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
19396 : * PyArray_SetBaseObject(arr, base)
19397 : *
19398 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
19399 : * base = PyArray_BASE(arr)
19400 : * if base is NULL:
19401 : */
19402 :
19403 : /* function exit code */
19404 : __pyx_L0:;
19405 : __Pyx_XGIVEREF(__pyx_r);
19406 : __Pyx_RefNannyFinishContext();
19407 : return __pyx_r;
19408 : }
19409 :
19410 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
19411 : * # Versions of the import_* functions which are more suitable for
19412 : * # Cython code.
19413 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
19414 : * try:
19415 : * __pyx_import_array()
19416 : */
19417 :
19418 1 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
19419 1 : int __pyx_r;
19420 : __Pyx_RefNannyDeclarations
19421 1 : PyObject *__pyx_t_1 = NULL;
19422 1 : PyObject *__pyx_t_2 = NULL;
19423 1 : PyObject *__pyx_t_3 = NULL;
19424 1 : int __pyx_t_4;
19425 1 : PyObject *__pyx_t_5 = NULL;
19426 1 : PyObject *__pyx_t_6 = NULL;
19427 1 : PyObject *__pyx_t_7 = NULL;
19428 1 : PyObject *__pyx_t_8 = NULL;
19429 1 : int __pyx_lineno = 0;
19430 1 : const char *__pyx_filename = NULL;
19431 1 : int __pyx_clineno = 0;
19432 1 : __Pyx_RefNannySetupContext("import_array", 1);
19433 :
19434 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
19435 : * # Cython code.
19436 : * cdef inline int import_array() except -1:
19437 : * try: # <<<<<<<<<<<<<<
19438 : * __pyx_import_array()
19439 : * except Exception:
19440 : */
19441 : {
19442 1 : __Pyx_PyThreadState_declare
19443 1 : __Pyx_PyThreadState_assign
19444 1 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
19445 1 : __Pyx_XGOTREF(__pyx_t_1);
19446 1 : __Pyx_XGOTREF(__pyx_t_2);
19447 1 : __Pyx_XGOTREF(__pyx_t_3);
19448 : /*try:*/ {
19449 :
19450 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1023
19451 : * cdef inline int import_array() except -1:
19452 : * try:
19453 : * __pyx_import_array() # <<<<<<<<<<<<<<
19454 : * except Exception:
19455 : * raise ImportError("numpy._core.multiarray failed to import")
19456 : */
19457 1 : __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1023, __pyx_L3_error)
19458 :
19459 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
19460 : * # Cython code.
19461 : * cdef inline int import_array() except -1:
19462 : * try: # <<<<<<<<<<<<<<
19463 : * __pyx_import_array()
19464 : * except Exception:
19465 : */
19466 : }
19467 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19468 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19469 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19470 1 : goto __pyx_L8_try_end;
19471 0 : __pyx_L3_error:;
19472 :
19473 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1024
19474 : * try:
19475 : * __pyx_import_array()
19476 : * except Exception: # <<<<<<<<<<<<<<
19477 : * raise ImportError("numpy._core.multiarray failed to import")
19478 : *
19479 : */
19480 0 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
19481 0 : if (__pyx_t_4) {
19482 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
19483 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1024, __pyx_L5_except_error)
19484 0 : __Pyx_XGOTREF(__pyx_t_5);
19485 0 : __Pyx_XGOTREF(__pyx_t_6);
19486 0 : __Pyx_XGOTREF(__pyx_t_7);
19487 :
19488 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
19489 : * __pyx_import_array()
19490 : * except Exception:
19491 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
19492 : *
19493 : * cdef inline int import_umath() except -1:
19494 : */
19495 0 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1025, __pyx_L5_except_error)
19496 0 : __Pyx_GOTREF(__pyx_t_8);
19497 0 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
19498 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19499 0 : __PYX_ERR(2, 1025, __pyx_L5_except_error)
19500 : }
19501 0 : goto __pyx_L5_except_error;
19502 :
19503 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
19504 : * # Cython code.
19505 : * cdef inline int import_array() except -1:
19506 : * try: # <<<<<<<<<<<<<<
19507 : * __pyx_import_array()
19508 : * except Exception:
19509 : */
19510 0 : __pyx_L5_except_error:;
19511 0 : __Pyx_XGIVEREF(__pyx_t_1);
19512 0 : __Pyx_XGIVEREF(__pyx_t_2);
19513 0 : __Pyx_XGIVEREF(__pyx_t_3);
19514 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
19515 0 : goto __pyx_L1_error;
19516 1 : __pyx_L8_try_end:;
19517 : }
19518 :
19519 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
19520 : * # Versions of the import_* functions which are more suitable for
19521 : * # Cython code.
19522 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
19523 : * try:
19524 : * __pyx_import_array()
19525 : */
19526 :
19527 : /* function exit code */
19528 1 : __pyx_r = 0;
19529 1 : goto __pyx_L0;
19530 0 : __pyx_L1_error:;
19531 0 : __Pyx_XDECREF(__pyx_t_5);
19532 0 : __Pyx_XDECREF(__pyx_t_6);
19533 0 : __Pyx_XDECREF(__pyx_t_7);
19534 0 : __Pyx_XDECREF(__pyx_t_8);
19535 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
19536 0 : __pyx_r = -1;
19537 1 : __pyx_L0:;
19538 1 : __Pyx_RefNannyFinishContext();
19539 1 : return __pyx_r;
19540 : }
19541 :
19542 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
19543 : * raise ImportError("numpy._core.multiarray failed to import")
19544 : *
19545 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
19546 : * try:
19547 : * _import_umath()
19548 : */
19549 :
19550 : static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
19551 : int __pyx_r;
19552 : __Pyx_RefNannyDeclarations
19553 : PyObject *__pyx_t_1 = NULL;
19554 : PyObject *__pyx_t_2 = NULL;
19555 : PyObject *__pyx_t_3 = NULL;
19556 : int __pyx_t_4;
19557 : PyObject *__pyx_t_5 = NULL;
19558 : PyObject *__pyx_t_6 = NULL;
19559 : PyObject *__pyx_t_7 = NULL;
19560 : PyObject *__pyx_t_8 = NULL;
19561 : int __pyx_lineno = 0;
19562 : const char *__pyx_filename = NULL;
19563 : int __pyx_clineno = 0;
19564 : __Pyx_RefNannySetupContext("import_umath", 1);
19565 :
19566 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
19567 : *
19568 : * cdef inline int import_umath() except -1:
19569 : * try: # <<<<<<<<<<<<<<
19570 : * _import_umath()
19571 : * except Exception:
19572 : */
19573 : {
19574 : __Pyx_PyThreadState_declare
19575 : __Pyx_PyThreadState_assign
19576 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
19577 : __Pyx_XGOTREF(__pyx_t_1);
19578 : __Pyx_XGOTREF(__pyx_t_2);
19579 : __Pyx_XGOTREF(__pyx_t_3);
19580 : /*try:*/ {
19581 :
19582 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1029
19583 : * cdef inline int import_umath() except -1:
19584 : * try:
19585 : * _import_umath() # <<<<<<<<<<<<<<
19586 : * except Exception:
19587 : * raise ImportError("numpy._core.umath failed to import")
19588 : */
19589 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1029, __pyx_L3_error)
19590 :
19591 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
19592 : *
19593 : * cdef inline int import_umath() except -1:
19594 : * try: # <<<<<<<<<<<<<<
19595 : * _import_umath()
19596 : * except Exception:
19597 : */
19598 : }
19599 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19600 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19601 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19602 : goto __pyx_L8_try_end;
19603 : __pyx_L3_error:;
19604 :
19605 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1030
19606 : * try:
19607 : * _import_umath()
19608 : * except Exception: # <<<<<<<<<<<<<<
19609 : * raise ImportError("numpy._core.umath failed to import")
19610 : *
19611 : */
19612 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
19613 : if (__pyx_t_4) {
19614 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
19615 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1030, __pyx_L5_except_error)
19616 : __Pyx_XGOTREF(__pyx_t_5);
19617 : __Pyx_XGOTREF(__pyx_t_6);
19618 : __Pyx_XGOTREF(__pyx_t_7);
19619 :
19620 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
19621 : * _import_umath()
19622 : * except Exception:
19623 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
19624 : *
19625 : * cdef inline int import_ufunc() except -1:
19626 : */
19627 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1031, __pyx_L5_except_error)
19628 : __Pyx_GOTREF(__pyx_t_8);
19629 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
19630 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19631 : __PYX_ERR(2, 1031, __pyx_L5_except_error)
19632 : }
19633 : goto __pyx_L5_except_error;
19634 :
19635 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
19636 : *
19637 : * cdef inline int import_umath() except -1:
19638 : * try: # <<<<<<<<<<<<<<
19639 : * _import_umath()
19640 : * except Exception:
19641 : */
19642 : __pyx_L5_except_error:;
19643 : __Pyx_XGIVEREF(__pyx_t_1);
19644 : __Pyx_XGIVEREF(__pyx_t_2);
19645 : __Pyx_XGIVEREF(__pyx_t_3);
19646 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
19647 : goto __pyx_L1_error;
19648 : __pyx_L8_try_end:;
19649 : }
19650 :
19651 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
19652 : * raise ImportError("numpy._core.multiarray failed to import")
19653 : *
19654 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
19655 : * try:
19656 : * _import_umath()
19657 : */
19658 :
19659 : /* function exit code */
19660 : __pyx_r = 0;
19661 : goto __pyx_L0;
19662 : __pyx_L1_error:;
19663 : __Pyx_XDECREF(__pyx_t_5);
19664 : __Pyx_XDECREF(__pyx_t_6);
19665 : __Pyx_XDECREF(__pyx_t_7);
19666 : __Pyx_XDECREF(__pyx_t_8);
19667 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
19668 : __pyx_r = -1;
19669 : __pyx_L0:;
19670 : __Pyx_RefNannyFinishContext();
19671 : return __pyx_r;
19672 : }
19673 :
19674 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
19675 : * raise ImportError("numpy._core.umath failed to import")
19676 : *
19677 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
19678 : * try:
19679 : * _import_umath()
19680 : */
19681 :
19682 : static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
19683 : int __pyx_r;
19684 : __Pyx_RefNannyDeclarations
19685 : PyObject *__pyx_t_1 = NULL;
19686 : PyObject *__pyx_t_2 = NULL;
19687 : PyObject *__pyx_t_3 = NULL;
19688 : int __pyx_t_4;
19689 : PyObject *__pyx_t_5 = NULL;
19690 : PyObject *__pyx_t_6 = NULL;
19691 : PyObject *__pyx_t_7 = NULL;
19692 : PyObject *__pyx_t_8 = NULL;
19693 : int __pyx_lineno = 0;
19694 : const char *__pyx_filename = NULL;
19695 : int __pyx_clineno = 0;
19696 : __Pyx_RefNannySetupContext("import_ufunc", 1);
19697 :
19698 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
19699 : *
19700 : * cdef inline int import_ufunc() except -1:
19701 : * try: # <<<<<<<<<<<<<<
19702 : * _import_umath()
19703 : * except Exception:
19704 : */
19705 : {
19706 : __Pyx_PyThreadState_declare
19707 : __Pyx_PyThreadState_assign
19708 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
19709 : __Pyx_XGOTREF(__pyx_t_1);
19710 : __Pyx_XGOTREF(__pyx_t_2);
19711 : __Pyx_XGOTREF(__pyx_t_3);
19712 : /*try:*/ {
19713 :
19714 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035
19715 : * cdef inline int import_ufunc() except -1:
19716 : * try:
19717 : * _import_umath() # <<<<<<<<<<<<<<
19718 : * except Exception:
19719 : * raise ImportError("numpy._core.umath failed to import")
19720 : */
19721 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1035, __pyx_L3_error)
19722 :
19723 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
19724 : *
19725 : * cdef inline int import_ufunc() except -1:
19726 : * try: # <<<<<<<<<<<<<<
19727 : * _import_umath()
19728 : * except Exception:
19729 : */
19730 : }
19731 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19732 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19733 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19734 : goto __pyx_L8_try_end;
19735 : __pyx_L3_error:;
19736 :
19737 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1036
19738 : * try:
19739 : * _import_umath()
19740 : * except Exception: # <<<<<<<<<<<<<<
19741 : * raise ImportError("numpy._core.umath failed to import")
19742 : *
19743 : */
19744 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
19745 : if (__pyx_t_4) {
19746 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
19747 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1036, __pyx_L5_except_error)
19748 : __Pyx_XGOTREF(__pyx_t_5);
19749 : __Pyx_XGOTREF(__pyx_t_6);
19750 : __Pyx_XGOTREF(__pyx_t_7);
19751 :
19752 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1037
19753 : * _import_umath()
19754 : * except Exception:
19755 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
19756 : *
19757 : *
19758 : */
19759 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1037, __pyx_L5_except_error)
19760 : __Pyx_GOTREF(__pyx_t_8);
19761 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
19762 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19763 : __PYX_ERR(2, 1037, __pyx_L5_except_error)
19764 : }
19765 : goto __pyx_L5_except_error;
19766 :
19767 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
19768 : *
19769 : * cdef inline int import_ufunc() except -1:
19770 : * try: # <<<<<<<<<<<<<<
19771 : * _import_umath()
19772 : * except Exception:
19773 : */
19774 : __pyx_L5_except_error:;
19775 : __Pyx_XGIVEREF(__pyx_t_1);
19776 : __Pyx_XGIVEREF(__pyx_t_2);
19777 : __Pyx_XGIVEREF(__pyx_t_3);
19778 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
19779 : goto __pyx_L1_error;
19780 : __pyx_L8_try_end:;
19781 : }
19782 :
19783 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
19784 : * raise ImportError("numpy._core.umath failed to import")
19785 : *
19786 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
19787 : * try:
19788 : * _import_umath()
19789 : */
19790 :
19791 : /* function exit code */
19792 : __pyx_r = 0;
19793 : goto __pyx_L0;
19794 : __pyx_L1_error:;
19795 : __Pyx_XDECREF(__pyx_t_5);
19796 : __Pyx_XDECREF(__pyx_t_6);
19797 : __Pyx_XDECREF(__pyx_t_7);
19798 : __Pyx_XDECREF(__pyx_t_8);
19799 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
19800 : __pyx_r = -1;
19801 : __pyx_L0:;
19802 : __Pyx_RefNannyFinishContext();
19803 : return __pyx_r;
19804 : }
19805 :
19806 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
19807 : *
19808 : *
19809 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
19810 : * """
19811 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
19812 : */
19813 :
19814 : static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
19815 : int __pyx_r;
19816 :
19817 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1052
19818 : * bool
19819 : * """
19820 : * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
19821 : *
19822 : *
19823 : */
19824 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
19825 : goto __pyx_L0;
19826 :
19827 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
19828 : *
19829 : *
19830 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
19831 : * """
19832 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
19833 : */
19834 :
19835 : /* function exit code */
19836 : __pyx_L0:;
19837 : return __pyx_r;
19838 : }
19839 :
19840 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
19841 : *
19842 : *
19843 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
19844 : * """
19845 : * Cython equivalent of `isinstance(obj, np.datetime64)`
19846 : */
19847 :
19848 : static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
19849 : int __pyx_r;
19850 :
19851 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1067
19852 : * bool
19853 : * """
19854 : * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
19855 : *
19856 : *
19857 : */
19858 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
19859 : goto __pyx_L0;
19860 :
19861 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
19862 : *
19863 : *
19864 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
19865 : * """
19866 : * Cython equivalent of `isinstance(obj, np.datetime64)`
19867 : */
19868 :
19869 : /* function exit code */
19870 : __pyx_L0:;
19871 : return __pyx_r;
19872 : }
19873 :
19874 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
19875 : *
19876 : *
19877 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
19878 : * """
19879 : * returns the int64 value underlying scalar numpy datetime64 object
19880 : */
19881 :
19882 : static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
19883 : npy_datetime __pyx_r;
19884 :
19885 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1077
19886 : * also needed. That can be found using `get_datetime64_unit`.
19887 : * """
19888 : * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
19889 : *
19890 : *
19891 : */
19892 : __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
19893 : goto __pyx_L0;
19894 :
19895 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
19896 : *
19897 : *
19898 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
19899 : * """
19900 : * returns the int64 value underlying scalar numpy datetime64 object
19901 : */
19902 :
19903 : /* function exit code */
19904 : __pyx_L0:;
19905 : return __pyx_r;
19906 : }
19907 :
19908 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
19909 : *
19910 : *
19911 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
19912 : * """
19913 : * returns the int64 value underlying scalar numpy timedelta64 object
19914 : */
19915 :
19916 : static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
19917 : npy_timedelta __pyx_r;
19918 :
19919 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1084
19920 : * returns the int64 value underlying scalar numpy timedelta64 object
19921 : * """
19922 : * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
19923 : *
19924 : *
19925 : */
19926 : __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
19927 : goto __pyx_L0;
19928 :
19929 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
19930 : *
19931 : *
19932 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
19933 : * """
19934 : * returns the int64 value underlying scalar numpy timedelta64 object
19935 : */
19936 :
19937 : /* function exit code */
19938 : __pyx_L0:;
19939 : return __pyx_r;
19940 : }
19941 :
19942 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
19943 : *
19944 : *
19945 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
19946 : * """
19947 : * returns the unit part of the dtype for a numpy datetime64 object.
19948 : */
19949 :
19950 : static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
19951 : NPY_DATETIMEUNIT __pyx_r;
19952 :
19953 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1091
19954 : * returns the unit part of the dtype for a numpy datetime64 object.
19955 : * """
19956 : * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
19957 : *
19958 : *
19959 : */
19960 : __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
19961 : goto __pyx_L0;
19962 :
19963 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
19964 : *
19965 : *
19966 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
19967 : * """
19968 : * returns the unit part of the dtype for a numpy datetime64 object.
19969 : */
19970 :
19971 : /* function exit code */
19972 : __pyx_L0:;
19973 : return __pyx_r;
19974 : }
19975 :
19976 : /* "scipy/sparse/csgraph/_matching.pyx":17
19977 : *
19978 : *
19979 : * def maximum_bipartite_matching(graph, perm_type='row'): # <<<<<<<<<<<<<<
19980 : * r"""
19981 : * maximum_bipartite_matching(graph, perm_type='row')
19982 : */
19983 :
19984 : /* Python wrapper */
19985 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_9_matching_1maximum_bipartite_matching(PyObject *__pyx_self,
19986 : #if CYTHON_METH_FASTCALL
19987 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
19988 : #else
19989 : PyObject *__pyx_args, PyObject *__pyx_kwds
19990 : #endif
19991 : ); /*proto*/
19992 : PyDoc_STRVAR(__pyx_doc_5scipy_6sparse_7csgraph_9_matching_maximum_bipartite_matching, "\n maximum_bipartite_matching(graph, perm_type='row')\n\n Returns a matching of a bipartite graph whose cardinality is as least that\n of any given matching of the graph.\n\n Parameters\n ----------\n graph : sparse matrix\n Input sparse in CSR format whose rows represent one partition of the\n graph and whose columns represent the other partition. An edge between\n two vertices is indicated by the corresponding entry in the matrix\n existing in its sparse representation.\n perm_type : str, {'row', 'column'}\n Which partition to return the matching in terms of: If ``'row'``, the\n function produces an array whose length is the number of columns in the\n input, and whose :math:`j`'th element is the row matched to the\n :math:`j`'th column. Conversely, if ``perm_type`` is ``'column'``, this\n returns the columns matched to each row.\n\n Returns\n -------\n perm : ndarray\n A matching of the vertices in one of the two partitions. Unmatched\n vertices are represented by a ``-1`` in the result.\n\n Notes\n -----\n This function implements the Hopcroft--Karp algorithm [1]_. Its time\n complexity is :math:`O(\\lvert E \\rvert \\sqrt{\\lvert V \\rvert})`, and its\n space complexity is linear in the number of rows. In practice, this\n asymmetry between rows and columns means that it can be more efficient to\n transpose the input if it contains more columns than rows.\n\n By Konig's theorem, the cardinality of the matching is also the number of\n vertices appearing in a minimum vertex cover of the graph.\n\n Note that if the sparse representation contains explicit zeros, these are\n still counted as edges.\n\n The implementation was changed in SciPy 1.4.0 to allow matching of general\n bipartite graphs, where previous versions would assume that a perfect\n matching existed. As such, code written against 1.4.0 will not necessarily""\n work on older versions.\n\n If multiple valid solutions are possible, output may vary with SciPy and\n Python version.\n\n References\n ----------\n .. [1] John E. Hopcroft and Richard M. Karp. \"An n^{5 / 2} Algorithm for\n Maximum Matchings in Bipartite Graphs\" In: SIAM Journal of Computing\n 2.4 (1973), pp. 225--231. :doi:`10.1137/0202019`\n\n Examples\n --------\n >>> from scipy.sparse import csr_matrix\n >>> from scipy.sparse.csgraph import maximum_bipartite_matching\n\n As a simple example, consider a bipartite graph in which the partitions\n contain 2 and 3 elements respectively. Suppose that one partition contains\n vertices labelled 0 and 1, and that the other partition contains vertices\n labelled A, B, and C. Suppose that there are edges connecting 0 and C,\n 1 and A, and 1 and B. This graph would then be represented by the following\n sparse matrix:\n\n >>> graph = csr_matrix([[0, 0, 1], [1, 1, 0]])\n\n Here, the 1s could be anything, as long as they end up being stored as\n elements in the sparse matrix. We can now calculate maximum matchings as\n follows:\n\n >>> print(maximum_bipartite_matching(graph, perm_type='column'))\n [2 0]\n >>> print(maximum_bipartite_matching(graph, perm_type='row'))\n [ 1 -1 0]\n\n The first output tells us that 1 and 2 are matched with C and A\n respectively, and the second output tells us that A, B, and C are matched\n with 1, nothing, and 0 respectively.\n\n Note that explicit zeros are still converted to edges. This means that a\n different way to represent the above graph is by using the CSR structure\n directly as follows:\n\n >>> data = [0, 0, 0]\n >>> indices = [2, 0, 1]\n >>> indptr = [0, 1, 3]\n >>> graph = csr_matrix((data, indices, indptr))\n >>> print(maximum_bipartite_matching(graph, perm_type='column'))\n [2 0]\n >>> print(maximum_bipartite_matching(graph, perm_type='row'))""\n [ 1 -1 0]\n\n When one or both of the partitions are empty, the matching is empty as\n well:\n\n >>> graph = csr_matrix((2, 0))\n >>> print(maximum_bipartite_matching(graph, perm_type='column'))\n [-1 -1]\n >>> print(maximum_bipartite_matching(graph, perm_type='row'))\n []\n\n When the input matrix is square, and the graph is known to admit a perfect\n matching, i.e. a matching with the property that every vertex in the graph\n belongs to some edge in the matching, then one can view the output as the\n permutation of rows (or columns) turning the input matrix into one with the\n property that all diagonal elements are non-empty:\n\n >>> a = [[0, 1, 2, 0], [1, 0, 0, 1], [2, 0, 0, 3], [0, 1, 3, 0]]\n >>> graph = csr_matrix(a)\n >>> perm = maximum_bipartite_matching(graph, perm_type='row')\n >>> print(graph[perm].toarray())\n [[1 0 0 1]\n [0 1 2 0]\n [0 1 3 0]\n [2 0 0 3]]\n\n ");
19993 : static PyMethodDef __pyx_mdef_5scipy_6sparse_7csgraph_9_matching_1maximum_bipartite_matching = {"maximum_bipartite_matching", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6sparse_7csgraph_9_matching_1maximum_bipartite_matching, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6sparse_7csgraph_9_matching_maximum_bipartite_matching};
19994 25 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_9_matching_1maximum_bipartite_matching(PyObject *__pyx_self,
19995 : #if CYTHON_METH_FASTCALL
19996 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
19997 : #else
19998 : PyObject *__pyx_args, PyObject *__pyx_kwds
19999 : #endif
20000 : ) {
20001 25 : PyObject *__pyx_v_graph = 0;
20002 25 : PyObject *__pyx_v_perm_type = 0;
20003 : #if !CYTHON_METH_FASTCALL
20004 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
20005 : #endif
20006 25 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
20007 25 : PyObject* values[2] = {0,0};
20008 25 : int __pyx_lineno = 0;
20009 25 : const char *__pyx_filename = NULL;
20010 25 : int __pyx_clineno = 0;
20011 25 : PyObject *__pyx_r = 0;
20012 : __Pyx_RefNannyDeclarations
20013 25 : __Pyx_RefNannySetupContext("maximum_bipartite_matching (wrapper)", 0);
20014 : #if !CYTHON_METH_FASTCALL
20015 : #if CYTHON_ASSUME_SAFE_MACROS
20016 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
20017 : #else
20018 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
20019 : #endif
20020 : #endif
20021 25 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
20022 : {
20023 25 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph,&__pyx_n_s_perm_type,0};
20024 25 : values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_row)));
20025 25 : if (__pyx_kwds) {
20026 20 : Py_ssize_t kw_args;
20027 20 : switch (__pyx_nargs) {
20028 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
20029 20 : CYTHON_FALLTHROUGH;
20030 20 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
20031 20 : CYTHON_FALLTHROUGH;
20032 20 : case 0: break;
20033 0 : default: goto __pyx_L5_argtuple_error;
20034 : }
20035 20 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
20036 20 : switch (__pyx_nargs) {
20037 : case 0:
20038 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_graph)) != 0)) {
20039 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
20040 0 : kw_args--;
20041 : }
20042 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error)
20043 0 : else goto __pyx_L5_argtuple_error;
20044 20 : CYTHON_FALLTHROUGH;
20045 : case 1:
20046 20 : if (kw_args > 0) {
20047 20 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_perm_type);
20048 20 : if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
20049 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error)
20050 : }
20051 : }
20052 20 : if (unlikely(kw_args > 0)) {
20053 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
20054 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "maximum_bipartite_matching") < 0)) __PYX_ERR(0, 17, __pyx_L3_error)
20055 : }
20056 : } else {
20057 5 : switch (__pyx_nargs) {
20058 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
20059 5 : CYTHON_FALLTHROUGH;
20060 5 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
20061 5 : break;
20062 0 : default: goto __pyx_L5_argtuple_error;
20063 : }
20064 : }
20065 25 : __pyx_v_graph = values[0];
20066 25 : __pyx_v_perm_type = values[1];
20067 : }
20068 25 : goto __pyx_L6_skip;
20069 0 : __pyx_L5_argtuple_error:;
20070 0 : __Pyx_RaiseArgtupleInvalid("maximum_bipartite_matching", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 17, __pyx_L3_error)
20071 25 : __pyx_L6_skip:;
20072 25 : goto __pyx_L4_argument_unpacking_done;
20073 0 : __pyx_L3_error:;
20074 : {
20075 0 : Py_ssize_t __pyx_temp;
20076 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20077 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
20078 : }
20079 : }
20080 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._matching.maximum_bipartite_matching", __pyx_clineno, __pyx_lineno, __pyx_filename);
20081 0 : __Pyx_RefNannyFinishContext();
20082 0 : return NULL;
20083 25 : __pyx_L4_argument_unpacking_done:;
20084 25 : __pyx_r = __pyx_pf_5scipy_6sparse_7csgraph_9_matching_maximum_bipartite_matching(__pyx_self, __pyx_v_graph, __pyx_v_perm_type);
20085 :
20086 : /* function exit code */
20087 : {
20088 25 : Py_ssize_t __pyx_temp;
20089 25 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20090 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
20091 : }
20092 : }
20093 : __Pyx_RefNannyFinishContext();
20094 : return __pyx_r;
20095 : }
20096 :
20097 25 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_9_matching_maximum_bipartite_matching(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_graph, PyObject *__pyx_v_perm_type) {
20098 25 : PyObject *__pyx_v_i = NULL;
20099 25 : PyObject *__pyx_v_j = NULL;
20100 25 : PyObject *__pyx_v_x = NULL;
20101 25 : PyObject *__pyx_v_y = NULL;
20102 25 : PyObject *__pyx_r = NULL;
20103 : __Pyx_RefNannyDeclarations
20104 25 : PyObject *__pyx_t_1 = NULL;
20105 25 : PyObject *__pyx_t_2 = NULL;
20106 25 : PyObject *__pyx_t_3 = NULL;
20107 25 : unsigned int __pyx_t_4;
20108 25 : int __pyx_t_5;
20109 25 : int __pyx_t_6;
20110 25 : PyObject *__pyx_t_7 = NULL;
20111 25 : PyObject *(*__pyx_t_8)(PyObject *);
20112 25 : __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
20113 25 : __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
20114 25 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_11;
20115 25 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_12;
20116 25 : int __pyx_lineno = 0;
20117 25 : const char *__pyx_filename = NULL;
20118 25 : int __pyx_clineno = 0;
20119 25 : __Pyx_RefNannySetupContext("maximum_bipartite_matching", 0);
20120 25 : __Pyx_INCREF(__pyx_v_graph);
20121 :
20122 : /* "scipy/sparse/csgraph/_matching.pyx":137
20123 : *
20124 : * """
20125 : * graph = convert_pydata_sparse_to_scipy(graph) # <<<<<<<<<<<<<<
20126 : * if not issparse(graph):
20127 : * raise TypeError("graph must be sparse")
20128 : */
20129 25 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_convert_pydata_sparse_to_scipy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
20130 25 : __Pyx_GOTREF(__pyx_t_2);
20131 25 : __pyx_t_3 = NULL;
20132 25 : __pyx_t_4 = 0;
20133 : #if CYTHON_UNPACK_METHODS
20134 25 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
20135 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
20136 0 : if (likely(__pyx_t_3)) {
20137 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20138 0 : __Pyx_INCREF(__pyx_t_3);
20139 0 : __Pyx_INCREF(function);
20140 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
20141 : __pyx_t_4 = 1;
20142 : }
20143 : }
20144 : #endif
20145 : {
20146 25 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_graph};
20147 25 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
20148 25 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20149 25 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
20150 25 : __Pyx_GOTREF(__pyx_t_1);
20151 25 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20152 : }
20153 25 : __Pyx_DECREF_SET(__pyx_v_graph, __pyx_t_1);
20154 25 : __pyx_t_1 = 0;
20155 :
20156 : /* "scipy/sparse/csgraph/_matching.pyx":138
20157 : * """
20158 : * graph = convert_pydata_sparse_to_scipy(graph)
20159 : * if not issparse(graph): # <<<<<<<<<<<<<<
20160 : * raise TypeError("graph must be sparse")
20161 : * if graph.format not in ("csr", "csc", "coo"):
20162 : */
20163 25 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_issparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error)
20164 25 : __Pyx_GOTREF(__pyx_t_2);
20165 25 : __pyx_t_3 = NULL;
20166 25 : __pyx_t_4 = 0;
20167 : #if CYTHON_UNPACK_METHODS
20168 25 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
20169 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
20170 0 : if (likely(__pyx_t_3)) {
20171 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20172 0 : __Pyx_INCREF(__pyx_t_3);
20173 0 : __Pyx_INCREF(function);
20174 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
20175 : __pyx_t_4 = 1;
20176 : }
20177 : }
20178 : #endif
20179 : {
20180 25 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_graph};
20181 25 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
20182 25 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20183 25 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
20184 25 : __Pyx_GOTREF(__pyx_t_1);
20185 25 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20186 : }
20187 25 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 138, __pyx_L1_error)
20188 25 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20189 25 : __pyx_t_6 = (!__pyx_t_5);
20190 25 : if (unlikely(__pyx_t_6)) {
20191 :
20192 : /* "scipy/sparse/csgraph/_matching.pyx":139
20193 : * graph = convert_pydata_sparse_to_scipy(graph)
20194 : * if not issparse(graph):
20195 : * raise TypeError("graph must be sparse") # <<<<<<<<<<<<<<
20196 : * if graph.format not in ("csr", "csc", "coo"):
20197 : * raise TypeError("graph must be in CSC, CSR, or COO format.")
20198 : */
20199 1 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
20200 1 : __Pyx_GOTREF(__pyx_t_1);
20201 1 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20202 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20203 1 : __PYX_ERR(0, 139, __pyx_L1_error)
20204 :
20205 : /* "scipy/sparse/csgraph/_matching.pyx":138
20206 : * """
20207 : * graph = convert_pydata_sparse_to_scipy(graph)
20208 : * if not issparse(graph): # <<<<<<<<<<<<<<
20209 : * raise TypeError("graph must be sparse")
20210 : * if graph.format not in ("csr", "csc", "coo"):
20211 : */
20212 : }
20213 :
20214 : /* "scipy/sparse/csgraph/_matching.pyx":140
20215 : * if not issparse(graph):
20216 : * raise TypeError("graph must be sparse")
20217 : * if graph.format not in ("csr", "csc", "coo"): # <<<<<<<<<<<<<<
20218 : * raise TypeError("graph must be in CSC, CSR, or COO format.")
20219 : * graph = graph.tocsr()
20220 : */
20221 24 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
20222 24 : __Pyx_GOTREF(__pyx_t_1);
20223 24 : __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_csr, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 140, __pyx_L1_error)
20224 24 : if (__pyx_t_5) {
20225 0 : } else {
20226 24 : __pyx_t_6 = __pyx_t_5;
20227 24 : goto __pyx_L5_bool_binop_done;
20228 : }
20229 0 : __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_csc, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 140, __pyx_L1_error)
20230 0 : if (__pyx_t_5) {
20231 0 : } else {
20232 0 : __pyx_t_6 = __pyx_t_5;
20233 0 : goto __pyx_L5_bool_binop_done;
20234 : }
20235 0 : __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_coo, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 140, __pyx_L1_error)
20236 : __pyx_t_6 = __pyx_t_5;
20237 24 : __pyx_L5_bool_binop_done:;
20238 24 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20239 24 : __pyx_t_5 = __pyx_t_6;
20240 24 : if (unlikely(__pyx_t_5)) {
20241 :
20242 : /* "scipy/sparse/csgraph/_matching.pyx":141
20243 : * raise TypeError("graph must be sparse")
20244 : * if graph.format not in ("csr", "csc", "coo"):
20245 : * raise TypeError("graph must be in CSC, CSR, or COO format.") # <<<<<<<<<<<<<<
20246 : * graph = graph.tocsr()
20247 : * i, j = graph.shape
20248 : */
20249 0 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
20250 0 : __Pyx_GOTREF(__pyx_t_1);
20251 0 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20252 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20253 0 : __PYX_ERR(0, 141, __pyx_L1_error)
20254 :
20255 : /* "scipy/sparse/csgraph/_matching.pyx":140
20256 : * if not issparse(graph):
20257 : * raise TypeError("graph must be sparse")
20258 : * if graph.format not in ("csr", "csc", "coo"): # <<<<<<<<<<<<<<
20259 : * raise TypeError("graph must be in CSC, CSR, or COO format.")
20260 : * graph = graph.tocsr()
20261 : */
20262 : }
20263 :
20264 : /* "scipy/sparse/csgraph/_matching.pyx":142
20265 : * if graph.format not in ("csr", "csc", "coo"):
20266 : * raise TypeError("graph must be in CSC, CSR, or COO format.")
20267 : * graph = graph.tocsr() # <<<<<<<<<<<<<<
20268 : * i, j = graph.shape
20269 : * x, y = _hopcroft_karp(graph.indices, graph.indptr, i, j)
20270 : */
20271 24 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_tocsr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
20272 24 : __Pyx_GOTREF(__pyx_t_2);
20273 24 : __pyx_t_3 = NULL;
20274 24 : __pyx_t_4 = 0;
20275 : #if CYTHON_UNPACK_METHODS
20276 24 : if (likely(PyMethod_Check(__pyx_t_2))) {
20277 24 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
20278 24 : if (likely(__pyx_t_3)) {
20279 24 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20280 24 : __Pyx_INCREF(__pyx_t_3);
20281 24 : __Pyx_INCREF(function);
20282 24 : __Pyx_DECREF_SET(__pyx_t_2, function);
20283 : __pyx_t_4 = 1;
20284 : }
20285 : }
20286 : #endif
20287 : {
20288 24 : PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
20289 24 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
20290 24 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20291 24 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
20292 24 : __Pyx_GOTREF(__pyx_t_1);
20293 24 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20294 : }
20295 24 : __Pyx_DECREF_SET(__pyx_v_graph, __pyx_t_1);
20296 24 : __pyx_t_1 = 0;
20297 :
20298 : /* "scipy/sparse/csgraph/_matching.pyx":143
20299 : * raise TypeError("graph must be in CSC, CSR, or COO format.")
20300 : * graph = graph.tocsr()
20301 : * i, j = graph.shape # <<<<<<<<<<<<<<
20302 : * x, y = _hopcroft_karp(graph.indices, graph.indptr, i, j)
20303 : * return np.asarray(x if perm_type == 'column' else y)
20304 : */
20305 24 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
20306 24 : __Pyx_GOTREF(__pyx_t_1);
20307 24 : if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
20308 24 : PyObject* sequence = __pyx_t_1;
20309 24 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
20310 24 : if (unlikely(size != 2)) {
20311 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
20312 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
20313 0 : __PYX_ERR(0, 143, __pyx_L1_error)
20314 : }
20315 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20316 24 : if (likely(PyTuple_CheckExact(sequence))) {
20317 24 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
20318 24 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
20319 : } else {
20320 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
20321 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
20322 : }
20323 24 : __Pyx_INCREF(__pyx_t_2);
20324 24 : __Pyx_INCREF(__pyx_t_3);
20325 : #else
20326 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
20327 : __Pyx_GOTREF(__pyx_t_2);
20328 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
20329 : __Pyx_GOTREF(__pyx_t_3);
20330 : #endif
20331 24 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20332 : } else {
20333 0 : Py_ssize_t index = -1;
20334 0 : __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error)
20335 0 : __Pyx_GOTREF(__pyx_t_7);
20336 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20337 0 : __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
20338 0 : index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
20339 0 : __Pyx_GOTREF(__pyx_t_2);
20340 0 : index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
20341 0 : __Pyx_GOTREF(__pyx_t_3);
20342 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
20343 0 : __pyx_t_8 = NULL;
20344 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20345 0 : goto __pyx_L9_unpacking_done;
20346 0 : __pyx_L8_unpacking_failed:;
20347 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20348 0 : __pyx_t_8 = NULL;
20349 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
20350 0 : __PYX_ERR(0, 143, __pyx_L1_error)
20351 0 : __pyx_L9_unpacking_done:;
20352 : }
20353 24 : __pyx_v_i = __pyx_t_2;
20354 24 : __pyx_t_2 = 0;
20355 24 : __pyx_v_j = __pyx_t_3;
20356 24 : __pyx_t_3 = 0;
20357 :
20358 : /* "scipy/sparse/csgraph/_matching.pyx":144
20359 : * graph = graph.tocsr()
20360 : * i, j = graph.shape
20361 : * x, y = _hopcroft_karp(graph.indices, graph.indptr, i, j) # <<<<<<<<<<<<<<
20362 : * return np.asarray(x if perm_type == 'column' else y)
20363 : *
20364 : */
20365 24 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
20366 24 : __Pyx_GOTREF(__pyx_t_1);
20367 24 : __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t__const__(__pyx_t_1, 0); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 144, __pyx_L1_error)
20368 24 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20369 24 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
20370 24 : __Pyx_GOTREF(__pyx_t_1);
20371 24 : __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t__const__(__pyx_t_1, 0); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 144, __pyx_L1_error)
20372 24 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20373 24 : __pyx_t_11 = __Pyx_PyInt_As_npy_int32(__pyx_v_i); if (unlikely((__pyx_t_11 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error)
20374 24 : __pyx_t_12 = __Pyx_PyInt_As_npy_int32(__pyx_v_j); if (unlikely((__pyx_t_12 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error)
20375 24 : __pyx_t_1 = __pyx_f_5scipy_6sparse_7csgraph_9_matching__hopcroft_karp(__pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
20376 24 : __Pyx_GOTREF(__pyx_t_1);
20377 24 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
20378 24 : __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL;
20379 24 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
20380 24 : __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL;
20381 24 : if (likely(__pyx_t_1 != Py_None)) {
20382 24 : PyObject* sequence = __pyx_t_1;
20383 24 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
20384 24 : if (unlikely(size != 2)) {
20385 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
20386 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
20387 0 : __PYX_ERR(0, 144, __pyx_L1_error)
20388 : }
20389 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20390 24 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
20391 24 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
20392 24 : __Pyx_INCREF(__pyx_t_3);
20393 24 : __Pyx_INCREF(__pyx_t_2);
20394 : #else
20395 : __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
20396 : __Pyx_GOTREF(__pyx_t_3);
20397 : __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
20398 : __Pyx_GOTREF(__pyx_t_2);
20399 : #endif
20400 24 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20401 : } else {
20402 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 144, __pyx_L1_error)
20403 : }
20404 24 : __pyx_v_x = __pyx_t_3;
20405 24 : __pyx_t_3 = 0;
20406 24 : __pyx_v_y = __pyx_t_2;
20407 24 : __pyx_t_2 = 0;
20408 :
20409 : /* "scipy/sparse/csgraph/_matching.pyx":145
20410 : * i, j = graph.shape
20411 : * x, y = _hopcroft_karp(graph.indices, graph.indptr, i, j)
20412 : * return np.asarray(x if perm_type == 'column' else y) # <<<<<<<<<<<<<<
20413 : *
20414 : *
20415 : */
20416 24 : __Pyx_XDECREF(__pyx_r);
20417 24 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
20418 24 : __Pyx_GOTREF(__pyx_t_2);
20419 24 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
20420 24 : __Pyx_GOTREF(__pyx_t_3);
20421 24 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20422 24 : __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_perm_type, __pyx_n_u_column, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 145, __pyx_L1_error)
20423 24 : if (__pyx_t_5) {
20424 10 : __Pyx_INCREF(__pyx_v_x);
20425 : __pyx_t_2 = __pyx_v_x;
20426 : } else {
20427 14 : __Pyx_INCREF(__pyx_v_y);
20428 : __pyx_t_2 = __pyx_v_y;
20429 : }
20430 24 : __pyx_t_7 = NULL;
20431 24 : __pyx_t_4 = 0;
20432 : #if CYTHON_UNPACK_METHODS
20433 24 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
20434 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
20435 0 : if (likely(__pyx_t_7)) {
20436 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
20437 0 : __Pyx_INCREF(__pyx_t_7);
20438 0 : __Pyx_INCREF(function);
20439 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
20440 : __pyx_t_4 = 1;
20441 : }
20442 : }
20443 : #endif
20444 : {
20445 24 : PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_2};
20446 24 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
20447 24 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
20448 24 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20449 24 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
20450 24 : __Pyx_GOTREF(__pyx_t_1);
20451 24 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20452 : }
20453 24 : __pyx_r = __pyx_t_1;
20454 24 : __pyx_t_1 = 0;
20455 24 : goto __pyx_L0;
20456 :
20457 : /* "scipy/sparse/csgraph/_matching.pyx":17
20458 : *
20459 : *
20460 : * def maximum_bipartite_matching(graph, perm_type='row'): # <<<<<<<<<<<<<<
20461 : * r"""
20462 : * maximum_bipartite_matching(graph, perm_type='row')
20463 : */
20464 :
20465 : /* function exit code */
20466 1 : __pyx_L1_error:;
20467 1 : __Pyx_XDECREF(__pyx_t_1);
20468 1 : __Pyx_XDECREF(__pyx_t_2);
20469 1 : __Pyx_XDECREF(__pyx_t_3);
20470 1 : __Pyx_XDECREF(__pyx_t_7);
20471 1 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
20472 1 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
20473 1 : __Pyx_AddTraceback("scipy.sparse.csgraph._matching.maximum_bipartite_matching", __pyx_clineno, __pyx_lineno, __pyx_filename);
20474 1 : __pyx_r = NULL;
20475 25 : __pyx_L0:;
20476 25 : __Pyx_XDECREF(__pyx_v_i);
20477 25 : __Pyx_XDECREF(__pyx_v_j);
20478 25 : __Pyx_XDECREF(__pyx_v_x);
20479 25 : __Pyx_XDECREF(__pyx_v_y);
20480 25 : __Pyx_XDECREF(__pyx_v_graph);
20481 25 : __Pyx_XGIVEREF(__pyx_r);
20482 25 : __Pyx_RefNannyFinishContext();
20483 25 : return __pyx_r;
20484 : }
20485 :
20486 : /* "scipy/sparse/csgraph/_matching.pyx":150
20487 : * @cython.boundscheck(False)
20488 : * @cython.wraparound(False)
20489 : * cdef tuple _hopcroft_karp(const ITYPE_t[:] indices, const ITYPE_t[:] indptr, # <<<<<<<<<<<<<<
20490 : * const ITYPE_t i, const ITYPE_t j):
20491 : * cdef ITYPE_t INF = np.iinfo(ITYPE).max
20492 : */
20493 :
20494 135 : static PyObject *__pyx_f_5scipy_6sparse_7csgraph_9_matching__hopcroft_karp(__Pyx_memviewslice __pyx_v_indices, __Pyx_memviewslice __pyx_v_indptr, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const __pyx_v_i, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const __pyx_v_j) {
20495 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_INF;
20496 135 : __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
20497 135 : __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
20498 135 : __Pyx_memviewslice __pyx_v_dist = { 0, 0, { 0 }, { 0 }, { 0 } };
20499 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_k;
20500 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_v;
20501 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_w;
20502 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_up;
20503 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_u;
20504 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_yu;
20505 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_u_old;
20506 135 : __Pyx_memviewslice __pyx_v_q = { 0, 0, { 0 }, { 0 }, { 0 } };
20507 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_head;
20508 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_tail;
20509 135 : __Pyx_memviewslice __pyx_v_stack = { 0, 0, { 0 }, { 0 }, { 0 } };
20510 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_stack_head;
20511 135 : __Pyx_memviewslice __pyx_v_parents = { 0, 0, { 0 }, { 0 }, { 0 } };
20512 135 : int __pyx_v_done;
20513 135 : CYTHON_UNUSED int __pyx_v_could_augment;
20514 135 : PyObject *__pyx_r = NULL;
20515 : __Pyx_RefNannyDeclarations
20516 135 : PyObject *__pyx_t_1 = NULL;
20517 135 : PyObject *__pyx_t_2 = NULL;
20518 135 : PyObject *__pyx_t_3 = NULL;
20519 135 : PyObject *__pyx_t_4 = NULL;
20520 135 : unsigned int __pyx_t_5;
20521 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_6;
20522 135 : __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
20523 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_8;
20524 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_9;
20525 135 : Py_ssize_t __pyx_t_10;
20526 135 : int __pyx_t_11;
20527 135 : Py_ssize_t __pyx_t_12;
20528 135 : Py_ssize_t __pyx_t_13;
20529 135 : Py_ssize_t __pyx_t_14;
20530 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_15;
20531 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_16;
20532 135 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_17;
20533 135 : int __pyx_lineno = 0;
20534 135 : const char *__pyx_filename = NULL;
20535 135 : int __pyx_clineno = 0;
20536 135 : __Pyx_RefNannySetupContext("_hopcroft_karp", 1);
20537 :
20538 : /* "scipy/sparse/csgraph/_matching.pyx":152
20539 : * cdef tuple _hopcroft_karp(const ITYPE_t[:] indices, const ITYPE_t[:] indptr,
20540 : * const ITYPE_t i, const ITYPE_t j):
20541 : * cdef ITYPE_t INF = np.iinfo(ITYPE).max # <<<<<<<<<<<<<<
20542 : * # x will end up containing the matchings of rows to columns, while
20543 : * # y will contain the matchings of columns to rows.
20544 : */
20545 135 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
20546 135 : __Pyx_GOTREF(__pyx_t_2);
20547 135 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
20548 135 : __Pyx_GOTREF(__pyx_t_3);
20549 135 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20550 135 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
20551 135 : __Pyx_GOTREF(__pyx_t_2);
20552 135 : __pyx_t_4 = NULL;
20553 135 : __pyx_t_5 = 0;
20554 : #if CYTHON_UNPACK_METHODS
20555 135 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
20556 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
20557 0 : if (likely(__pyx_t_4)) {
20558 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
20559 0 : __Pyx_INCREF(__pyx_t_4);
20560 0 : __Pyx_INCREF(function);
20561 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
20562 : __pyx_t_5 = 1;
20563 : }
20564 : }
20565 : #endif
20566 : {
20567 135 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
20568 135 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
20569 135 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20570 135 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20571 135 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
20572 135 : __Pyx_GOTREF(__pyx_t_1);
20573 135 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20574 : }
20575 135 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
20576 135 : __Pyx_GOTREF(__pyx_t_3);
20577 135 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20578 135 : __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_t_3); if (unlikely((__pyx_t_6 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error)
20579 135 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20580 135 : __pyx_v_INF = __pyx_t_6;
20581 :
20582 : /* "scipy/sparse/csgraph/_matching.pyx":155
20583 : * # x will end up containing the matchings of rows to columns, while
20584 : * # y will contain the matchings of columns to rows.
20585 : * cdef ITYPE_t[:] x = np.empty(i, dtype=ITYPE) # <<<<<<<<<<<<<<
20586 : * cdef ITYPE_t[:] y = np.empty(j, dtype=ITYPE)
20587 : *
20588 : */
20589 135 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
20590 135 : __Pyx_GOTREF(__pyx_t_3);
20591 135 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
20592 135 : __Pyx_GOTREF(__pyx_t_1);
20593 135 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20594 135 : __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
20595 135 : __Pyx_GOTREF(__pyx_t_3);
20596 135 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
20597 135 : __Pyx_GOTREF(__pyx_t_2);
20598 135 : __Pyx_GIVEREF(__pyx_t_3);
20599 135 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error);
20600 135 : __pyx_t_3 = 0;
20601 135 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
20602 135 : __Pyx_GOTREF(__pyx_t_3);
20603 135 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
20604 135 : __Pyx_GOTREF(__pyx_t_4);
20605 135 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
20606 135 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20607 135 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
20608 135 : __Pyx_GOTREF(__pyx_t_4);
20609 135 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20610 135 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20611 135 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20612 135 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 155, __pyx_L1_error)
20613 135 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20614 135 : __pyx_v_x = __pyx_t_7;
20615 135 : __pyx_t_7.memview = NULL;
20616 135 : __pyx_t_7.data = NULL;
20617 :
20618 : /* "scipy/sparse/csgraph/_matching.pyx":156
20619 : * # y will contain the matchings of columns to rows.
20620 : * cdef ITYPE_t[:] x = np.empty(i, dtype=ITYPE)
20621 : * cdef ITYPE_t[:] y = np.empty(j, dtype=ITYPE) # <<<<<<<<<<<<<<
20622 : *
20623 : * # During the BFS step, dist will keep track of the level of the search. We
20624 : */
20625 135 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
20626 135 : __Pyx_GOTREF(__pyx_t_4);
20627 135 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
20628 135 : __Pyx_GOTREF(__pyx_t_3);
20629 135 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20630 135 : __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_j); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
20631 135 : __Pyx_GOTREF(__pyx_t_4);
20632 135 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
20633 135 : __Pyx_GOTREF(__pyx_t_2);
20634 135 : __Pyx_GIVEREF(__pyx_t_4);
20635 135 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error);
20636 135 : __pyx_t_4 = 0;
20637 135 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
20638 135 : __Pyx_GOTREF(__pyx_t_4);
20639 135 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
20640 135 : __Pyx_GOTREF(__pyx_t_1);
20641 135 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
20642 135 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20643 135 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
20644 135 : __Pyx_GOTREF(__pyx_t_1);
20645 135 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20646 135 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20647 135 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20648 135 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 156, __pyx_L1_error)
20649 135 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20650 135 : __pyx_v_y = __pyx_t_7;
20651 135 : __pyx_t_7.memview = NULL;
20652 135 : __pyx_t_7.data = NULL;
20653 :
20654 : /* "scipy/sparse/csgraph/_matching.pyx":164
20655 : * # auxiliary vertex whose index will be i, and whose semantics are that
20656 : * # every unmatched column will be matched with this vertex.
20657 : * cdef ITYPE_t[:] dist = np.empty(i + 1, dtype=ITYPE) # <<<<<<<<<<<<<<
20658 : *
20659 : * cdef ITYPE_t k, v, w, up, u, yu, u_old
20660 : */
20661 135 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
20662 135 : __Pyx_GOTREF(__pyx_t_1);
20663 135 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error)
20664 135 : __Pyx_GOTREF(__pyx_t_4);
20665 135 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20666 135 : __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_i + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
20667 135 : __Pyx_GOTREF(__pyx_t_1);
20668 135 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error)
20669 135 : __Pyx_GOTREF(__pyx_t_2);
20670 135 : __Pyx_GIVEREF(__pyx_t_1);
20671 135 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error);
20672 135 : __pyx_t_1 = 0;
20673 135 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
20674 135 : __Pyx_GOTREF(__pyx_t_1);
20675 135 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
20676 135 : __Pyx_GOTREF(__pyx_t_3);
20677 135 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 164, __pyx_L1_error)
20678 135 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20679 135 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
20680 135 : __Pyx_GOTREF(__pyx_t_3);
20681 135 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20682 135 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20683 135 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20684 135 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 164, __pyx_L1_error)
20685 135 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20686 135 : __pyx_v_dist = __pyx_t_7;
20687 135 : __pyx_t_7.memview = NULL;
20688 135 : __pyx_t_7.data = NULL;
20689 :
20690 : /* "scipy/sparse/csgraph/_matching.pyx":172
20691 : * # matched to the auxiliary vertex i, and we will set their value to -1
20692 : * # only when we have found a maximum matching.
20693 : * for k in range(i): # <<<<<<<<<<<<<<
20694 : * x[k] = -1
20695 : *
20696 : */
20697 135 : __pyx_t_6 = __pyx_v_i;
20698 135 : __pyx_t_8 = __pyx_t_6;
20699 10305 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
20700 10170 : __pyx_v_k = __pyx_t_9;
20701 :
20702 : /* "scipy/sparse/csgraph/_matching.pyx":173
20703 : * # only when we have found a maximum matching.
20704 : * for k in range(i):
20705 : * x[k] = -1 # <<<<<<<<<<<<<<
20706 : *
20707 : * for k in range(j):
20708 : */
20709 10170 : __pyx_t_10 = __pyx_v_k;
20710 10170 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_10 * __pyx_v_x.strides[0]) )) = -1;
20711 : }
20712 :
20713 : /* "scipy/sparse/csgraph/_matching.pyx":175
20714 : * x[k] = -1
20715 : *
20716 : * for k in range(j): # <<<<<<<<<<<<<<
20717 : * y[k] = i
20718 : *
20719 : */
20720 10330 : __pyx_t_6 = __pyx_v_j;
20721 10330 : __pyx_t_8 = __pyx_t_6;
20722 10330 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
20723 10195 : __pyx_v_k = __pyx_t_9;
20724 :
20725 : /* "scipy/sparse/csgraph/_matching.pyx":176
20726 : *
20727 : * for k in range(j):
20728 : * y[k] = i # <<<<<<<<<<<<<<
20729 : *
20730 : * # Set up three structures for use in our searches: q will represent a queue
20731 : */
20732 10195 : __pyx_t_10 = __pyx_v_k;
20733 10195 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_10 * __pyx_v_y.strides[0]) )) = __pyx_v_i;
20734 : }
20735 :
20736 : /* "scipy/sparse/csgraph/_matching.pyx":185
20737 : * # tail to keep track of the ends of the queue: Elements are dequeued from
20738 : * # head and queued at tail.
20739 : * cdef ITYPE_t[:] q = np.empty(i + 1, dtype=ITYPE) # <<<<<<<<<<<<<<
20740 : * cdef ITYPE_t head, tail
20741 : *
20742 : */
20743 135 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
20744 135 : __Pyx_GOTREF(__pyx_t_3);
20745 135 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
20746 135 : __Pyx_GOTREF(__pyx_t_1);
20747 135 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20748 135 : __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_i + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
20749 135 : __Pyx_GOTREF(__pyx_t_3);
20750 135 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
20751 135 : __Pyx_GOTREF(__pyx_t_2);
20752 135 : __Pyx_GIVEREF(__pyx_t_3);
20753 135 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error);
20754 135 : __pyx_t_3 = 0;
20755 135 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
20756 135 : __Pyx_GOTREF(__pyx_t_3);
20757 135 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
20758 135 : __Pyx_GOTREF(__pyx_t_4);
20759 135 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 185, __pyx_L1_error)
20760 135 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20761 135 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
20762 135 : __Pyx_GOTREF(__pyx_t_4);
20763 135 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20764 135 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20765 135 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20766 135 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 185, __pyx_L1_error)
20767 135 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20768 135 : __pyx_v_q = __pyx_t_7;
20769 135 : __pyx_t_7.memview = NULL;
20770 135 : __pyx_t_7.data = NULL;
20771 :
20772 : /* "scipy/sparse/csgraph/_matching.pyx":193
20773 : * # (as represented by i), the stack capacity can be limited to i + 1.
20774 : * # Elements will be pushed to stack_head and popped from stack_head - 1.
20775 : * cdef ITYPE_t[:] stack = np.empty(i + 1, dtype=ITYPE) # <<<<<<<<<<<<<<
20776 : * cdef ITYPE_t stack_head
20777 : *
20778 : */
20779 135 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
20780 135 : __Pyx_GOTREF(__pyx_t_4);
20781 135 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
20782 135 : __Pyx_GOTREF(__pyx_t_3);
20783 135 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20784 135 : __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_i + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
20785 135 : __Pyx_GOTREF(__pyx_t_4);
20786 135 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
20787 135 : __Pyx_GOTREF(__pyx_t_2);
20788 135 : __Pyx_GIVEREF(__pyx_t_4);
20789 135 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error);
20790 135 : __pyx_t_4 = 0;
20791 135 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
20792 135 : __Pyx_GOTREF(__pyx_t_4);
20793 135 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
20794 135 : __Pyx_GOTREF(__pyx_t_1);
20795 135 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
20796 135 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20797 135 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
20798 135 : __Pyx_GOTREF(__pyx_t_1);
20799 135 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20800 135 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20801 135 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20802 135 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 193, __pyx_L1_error)
20803 135 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20804 135 : __pyx_v_stack = __pyx_t_7;
20805 135 : __pyx_t_7.memview = NULL;
20806 135 : __pyx_t_7.data = NULL;
20807 :
20808 : /* "scipy/sparse/csgraph/_matching.pyx":199
20809 : * # which we move. This will simplify the updates to the matching that occur
20810 : * # when an augmenting path is found.
20811 : * cdef ITYPE_t[:] parents = np.empty(i, dtype=ITYPE) # <<<<<<<<<<<<<<
20812 : *
20813 : * # The breadth-first search part of the algorithm. This will terminate when
20814 : */
20815 135 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
20816 135 : __Pyx_GOTREF(__pyx_t_1);
20817 135 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error)
20818 135 : __Pyx_GOTREF(__pyx_t_4);
20819 135 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20820 135 : __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
20821 135 : __Pyx_GOTREF(__pyx_t_1);
20822 135 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error)
20823 135 : __Pyx_GOTREF(__pyx_t_2);
20824 135 : __Pyx_GIVEREF(__pyx_t_1);
20825 135 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error);
20826 135 : __pyx_t_1 = 0;
20827 135 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
20828 135 : __Pyx_GOTREF(__pyx_t_1);
20829 135 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error)
20830 135 : __Pyx_GOTREF(__pyx_t_3);
20831 135 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
20832 135 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20833 135 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error)
20834 135 : __Pyx_GOTREF(__pyx_t_3);
20835 135 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20836 135 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20837 135 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20838 135 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 199, __pyx_L1_error)
20839 135 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20840 135 : __pyx_v_parents = __pyx_t_7;
20841 135 : __pyx_t_7.memview = NULL;
20842 135 : __pyx_t_7.data = NULL;
20843 :
20844 : /* "scipy/sparse/csgraph/_matching.pyx":204
20845 : * # we are unable to find a path to an unassigned vertex, which boils down to
20846 : * # not being able to find a path to the auxiliary vertex i.
20847 : * while True: # <<<<<<<<<<<<<<
20848 : * # Empty the queue by resetting the two pointers.
20849 : * head = 0
20850 : */
20851 537 : while (1) {
20852 :
20853 : /* "scipy/sparse/csgraph/_matching.pyx":206
20854 : * while True:
20855 : * # Empty the queue by resetting the two pointers.
20856 : * head = 0 # <<<<<<<<<<<<<<
20857 : * tail = 0
20858 : * for v in range(i):
20859 : */
20860 537 : __pyx_v_head = 0;
20861 :
20862 : /* "scipy/sparse/csgraph/_matching.pyx":207
20863 : * # Empty the queue by resetting the two pointers.
20864 : * head = 0
20865 : * tail = 0 # <<<<<<<<<<<<<<
20866 : * for v in range(i):
20867 : * if x[v] < 0:
20868 : */
20869 537 : __pyx_v_tail = 0;
20870 :
20871 : /* "scipy/sparse/csgraph/_matching.pyx":208
20872 : * head = 0
20873 : * tail = 0
20874 : * for v in range(i): # <<<<<<<<<<<<<<
20875 : * if x[v] < 0:
20876 : * dist[v] = 0
20877 : */
20878 537 : __pyx_t_6 = __pyx_v_i;
20879 537 : __pyx_t_8 = __pyx_t_6;
20880 48216 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
20881 47679 : __pyx_v_v = __pyx_t_9;
20882 :
20883 : /* "scipy/sparse/csgraph/_matching.pyx":209
20884 : * tail = 0
20885 : * for v in range(i):
20886 : * if x[v] < 0: # <<<<<<<<<<<<<<
20887 : * dist[v] = 0
20888 : * # Enqueue v. Note that in an ordinary circular buffer, we would
20889 : */
20890 47679 : __pyx_t_10 = __pyx_v_v;
20891 47679 : __pyx_t_11 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_10 * __pyx_v_x.strides[0]) ))) < 0);
20892 47679 : if (__pyx_t_11) {
20893 :
20894 : /* "scipy/sparse/csgraph/_matching.pyx":210
20895 : * for v in range(i):
20896 : * if x[v] < 0:
20897 : * dist[v] = 0 # <<<<<<<<<<<<<<
20898 : * # Enqueue v. Note that in an ordinary circular buffer, we would
20899 : * # avoid overflows by wrapping around indices, but since we will
20900 : */
20901 11834 : __pyx_t_10 = __pyx_v_v;
20902 11834 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_dist.data + __pyx_t_10 * __pyx_v_dist.strides[0]) )) = 0;
20903 :
20904 : /* "scipy/sparse/csgraph/_matching.pyx":215
20905 : * # never enqueue more than i + 1 different elements at a single
20906 : * # iteration, we can avoid doing so.
20907 : * q[tail] = v # <<<<<<<<<<<<<<
20908 : * tail += 1
20909 : * else:
20910 : */
20911 11834 : __pyx_t_10 = __pyx_v_tail;
20912 11834 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_q.data + __pyx_t_10 * __pyx_v_q.strides[0]) )) = __pyx_v_v;
20913 :
20914 : /* "scipy/sparse/csgraph/_matching.pyx":216
20915 : * # iteration, we can avoid doing so.
20916 : * q[tail] = v
20917 : * tail += 1 # <<<<<<<<<<<<<<
20918 : * else:
20919 : * dist[v] = INF
20920 : */
20921 11834 : __pyx_v_tail = (__pyx_v_tail + 1);
20922 :
20923 : /* "scipy/sparse/csgraph/_matching.pyx":209
20924 : * tail = 0
20925 : * for v in range(i):
20926 : * if x[v] < 0: # <<<<<<<<<<<<<<
20927 : * dist[v] = 0
20928 : * # Enqueue v. Note that in an ordinary circular buffer, we would
20929 : */
20930 11834 : goto __pyx_L11;
20931 : }
20932 :
20933 : /* "scipy/sparse/csgraph/_matching.pyx":218
20934 : * tail += 1
20935 : * else:
20936 : * dist[v] = INF # <<<<<<<<<<<<<<
20937 : * dist[i] = INF
20938 : * # Check if the queue is empty. Note than in an ordinary circular buffer
20939 : */
20940 : /*else*/ {
20941 35845 : __pyx_t_10 = __pyx_v_v;
20942 35845 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_dist.data + __pyx_t_10 * __pyx_v_dist.strides[0]) )) = __pyx_v_INF;
20943 : }
20944 47679 : __pyx_L11:;
20945 : }
20946 :
20947 : /* "scipy/sparse/csgraph/_matching.pyx":219
20948 : * else:
20949 : * dist[v] = INF
20950 : * dist[i] = INF # <<<<<<<<<<<<<<
20951 : * # Check if the queue is empty. Note than in an ordinary circular buffer
20952 : * # some care needs to be taken with this check when the buffer is full,
20953 : */
20954 537 : __pyx_t_10 = __pyx_v_i;
20955 537 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_dist.data + __pyx_t_10 * __pyx_v_dist.strides[0]) )) = __pyx_v_INF;
20956 :
20957 : /* "scipy/sparse/csgraph/_matching.pyx":223
20958 : * # some care needs to be taken with this check when the buffer is full,
20959 : * # which we can avoid as above.
20960 : * while head < tail: # <<<<<<<<<<<<<<
20961 : * v = q[head]
20962 : * head += 1
20963 : */
20964 38007 : while (1) {
20965 38007 : __pyx_t_11 = (__pyx_v_head < __pyx_v_tail);
20966 38007 : if (!__pyx_t_11) break;
20967 :
20968 : /* "scipy/sparse/csgraph/_matching.pyx":224
20969 : * # which we can avoid as above.
20970 : * while head < tail:
20971 : * v = q[head] # <<<<<<<<<<<<<<
20972 : * head += 1
20973 : * if dist[v] < dist[i]:
20974 : */
20975 37470 : __pyx_t_10 = __pyx_v_head;
20976 37470 : __pyx_v_v = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_q.data + __pyx_t_10 * __pyx_v_q.strides[0]) )));
20977 :
20978 : /* "scipy/sparse/csgraph/_matching.pyx":225
20979 : * while head < tail:
20980 : * v = q[head]
20981 : * head += 1 # <<<<<<<<<<<<<<
20982 : * if dist[v] < dist[i]:
20983 : * for up in range(indptr[v], indptr[v+1]):
20984 : */
20985 37470 : __pyx_v_head = (__pyx_v_head + 1);
20986 :
20987 : /* "scipy/sparse/csgraph/_matching.pyx":226
20988 : * v = q[head]
20989 : * head += 1
20990 : * if dist[v] < dist[i]: # <<<<<<<<<<<<<<
20991 : * for up in range(indptr[v], indptr[v+1]):
20992 : * u = indices[up]
20993 : */
20994 37470 : __pyx_t_10 = __pyx_v_v;
20995 37470 : __pyx_t_12 = __pyx_v_i;
20996 37470 : __pyx_t_11 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_dist.data + __pyx_t_10 * __pyx_v_dist.strides[0]) ))) < (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_dist.data + __pyx_t_12 * __pyx_v_dist.strides[0]) ))));
20997 37470 : if (__pyx_t_11) {
20998 :
20999 : /* "scipy/sparse/csgraph/_matching.pyx":227
21000 : * head += 1
21001 : * if dist[v] < dist[i]:
21002 : * for up in range(indptr[v], indptr[v+1]): # <<<<<<<<<<<<<<
21003 : * u = indices[up]
21004 : * if dist[y[u]] == INF:
21005 : */
21006 27698 : __pyx_t_12 = (__pyx_v_v + 1);
21007 27698 : __pyx_t_6 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_indptr.data + __pyx_t_12 * __pyx_v_indptr.strides[0]) )));
21008 27698 : __pyx_t_12 = __pyx_v_v;
21009 27698 : __pyx_t_8 = __pyx_t_6;
21010 189908 : for (__pyx_t_9 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_indptr.data + __pyx_t_12 * __pyx_v_indptr.strides[0]) ))); __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
21011 162210 : __pyx_v_up = __pyx_t_9;
21012 :
21013 : /* "scipy/sparse/csgraph/_matching.pyx":228
21014 : * if dist[v] < dist[i]:
21015 : * for up in range(indptr[v], indptr[v+1]):
21016 : * u = indices[up] # <<<<<<<<<<<<<<
21017 : * if dist[y[u]] == INF:
21018 : * dist[y[u]] = dist[v] + 1
21019 : */
21020 162210 : __pyx_t_10 = __pyx_v_up;
21021 162210 : __pyx_v_u = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_10 * __pyx_v_indices.strides[0]) )));
21022 :
21023 : /* "scipy/sparse/csgraph/_matching.pyx":229
21024 : * for up in range(indptr[v], indptr[v+1]):
21025 : * u = indices[up]
21026 : * if dist[y[u]] == INF: # <<<<<<<<<<<<<<
21027 : * dist[y[u]] = dist[v] + 1
21028 : * q[tail] = y[u]
21029 : */
21030 162210 : __pyx_t_10 = __pyx_v_u;
21031 162210 : __pyx_t_13 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_10 * __pyx_v_y.strides[0]) )));
21032 162210 : __pyx_t_11 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_dist.data + __pyx_t_13 * __pyx_v_dist.strides[0]) ))) == __pyx_v_INF);
21033 162210 : if (__pyx_t_11) {
21034 :
21035 : /* "scipy/sparse/csgraph/_matching.pyx":230
21036 : * u = indices[up]
21037 : * if dist[y[u]] == INF:
21038 : * dist[y[u]] = dist[v] + 1 # <<<<<<<<<<<<<<
21039 : * q[tail] = y[u]
21040 : * tail += 1
21041 : */
21042 25636 : __pyx_t_10 = __pyx_v_v;
21043 25636 : __pyx_t_13 = __pyx_v_u;
21044 25636 : __pyx_t_14 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_13 * __pyx_v_y.strides[0]) )));
21045 25636 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_dist.data + __pyx_t_14 * __pyx_v_dist.strides[0]) )) = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_dist.data + __pyx_t_10 * __pyx_v_dist.strides[0]) ))) + 1);
21046 :
21047 : /* "scipy/sparse/csgraph/_matching.pyx":231
21048 : * if dist[y[u]] == INF:
21049 : * dist[y[u]] = dist[v] + 1
21050 : * q[tail] = y[u] # <<<<<<<<<<<<<<
21051 : * tail += 1
21052 : * # Vertices not encountered during the BFS will have a dist of INF. In
21053 : */
21054 25636 : __pyx_t_10 = __pyx_v_u;
21055 25636 : __pyx_t_13 = __pyx_v_tail;
21056 25636 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_q.data + __pyx_t_13 * __pyx_v_q.strides[0]) )) = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_10 * __pyx_v_y.strides[0]) )));
21057 :
21058 : /* "scipy/sparse/csgraph/_matching.pyx":232
21059 : * dist[y[u]] = dist[v] + 1
21060 : * q[tail] = y[u]
21061 : * tail += 1 # <<<<<<<<<<<<<<
21062 : * # Vertices not encountered during the BFS will have a dist of INF. In
21063 : * # particular, dist[i] will be INF exactly when we did not encounter any
21064 : */
21065 25636 : __pyx_v_tail = (__pyx_v_tail + 1);
21066 :
21067 : /* "scipy/sparse/csgraph/_matching.pyx":229
21068 : * for up in range(indptr[v], indptr[v+1]):
21069 : * u = indices[up]
21070 : * if dist[y[u]] == INF: # <<<<<<<<<<<<<<
21071 : * dist[y[u]] = dist[v] + 1
21072 : * q[tail] = y[u]
21073 : */
21074 : }
21075 : }
21076 :
21077 : /* "scipy/sparse/csgraph/_matching.pyx":226
21078 : * v = q[head]
21079 : * head += 1
21080 : * if dist[v] < dist[i]: # <<<<<<<<<<<<<<
21081 : * for up in range(indptr[v], indptr[v+1]):
21082 : * u = indices[up]
21083 : */
21084 : }
21085 : }
21086 :
21087 : /* "scipy/sparse/csgraph/_matching.pyx":236
21088 : * # particular, dist[i] will be INF exactly when we did not encounter any
21089 : * # unmatched vertices.
21090 : * if dist[i] == INF: # <<<<<<<<<<<<<<
21091 : * break
21092 : *
21093 : */
21094 537 : __pyx_t_12 = __pyx_v_i;
21095 537 : __pyx_t_11 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_dist.data + __pyx_t_12 * __pyx_v_dist.strides[0]) ))) == __pyx_v_INF);
21096 537 : if (__pyx_t_11) {
21097 :
21098 : /* "scipy/sparse/csgraph/_matching.pyx":237
21099 : * # unmatched vertices.
21100 : * if dist[i] == INF:
21101 : * break # <<<<<<<<<<<<<<
21102 : *
21103 : * # Depth-first search starting from every unmatched vertex.
21104 : */
21105 135 : goto __pyx_L8_break;
21106 :
21107 : /* "scipy/sparse/csgraph/_matching.pyx":236
21108 : * # particular, dist[i] will be INF exactly when we did not encounter any
21109 : * # unmatched vertices.
21110 : * if dist[i] == INF: # <<<<<<<<<<<<<<
21111 : * break
21112 : *
21113 : */
21114 : }
21115 :
21116 : /* "scipy/sparse/csgraph/_matching.pyx":240
21117 : *
21118 : * # Depth-first search starting from every unmatched vertex.
21119 : * for w in range(i): # <<<<<<<<<<<<<<
21120 : * if x[w] < 0:
21121 : * done = False
21122 : */
21123 37911 : __pyx_t_6 = __pyx_v_i;
21124 37911 : __pyx_t_8 = __pyx_t_6;
21125 37911 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
21126 37509 : __pyx_v_w = __pyx_t_9;
21127 :
21128 : /* "scipy/sparse/csgraph/_matching.pyx":241
21129 : * # Depth-first search starting from every unmatched vertex.
21130 : * for w in range(i):
21131 : * if x[w] < 0: # <<<<<<<<<<<<<<
21132 : * done = False
21133 : * # Initialize stack to contain only w and reset path.
21134 : */
21135 37509 : __pyx_t_12 = __pyx_v_w;
21136 37509 : __pyx_t_11 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) ))) < 0);
21137 37509 : if (__pyx_t_11) {
21138 :
21139 : /* "scipy/sparse/csgraph/_matching.pyx":242
21140 : * for w in range(i):
21141 : * if x[w] < 0:
21142 : * done = False # <<<<<<<<<<<<<<
21143 : * # Initialize stack to contain only w and reset path.
21144 : * stack[0] = w
21145 : */
21146 11763 : __pyx_v_done = 0;
21147 :
21148 : /* "scipy/sparse/csgraph/_matching.pyx":244
21149 : * done = False
21150 : * # Initialize stack to contain only w and reset path.
21151 : * stack[0] = w # <<<<<<<<<<<<<<
21152 : * stack_head = 1
21153 : * while stack_head != 0:
21154 : */
21155 11763 : __pyx_t_12 = 0;
21156 11763 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_stack.data + __pyx_t_12 * __pyx_v_stack.strides[0]) )) = __pyx_v_w;
21157 :
21158 : /* "scipy/sparse/csgraph/_matching.pyx":245
21159 : * # Initialize stack to contain only w and reset path.
21160 : * stack[0] = w
21161 : * stack_head = 1 # <<<<<<<<<<<<<<
21162 : * while stack_head != 0:
21163 : * # Pop v from stack.
21164 : */
21165 11763 : __pyx_v_stack_head = 1;
21166 :
21167 : /* "scipy/sparse/csgraph/_matching.pyx":246
21168 : * stack[0] = w
21169 : * stack_head = 1
21170 : * while stack_head != 0: # <<<<<<<<<<<<<<
21171 : * # Pop v from stack.
21172 : * stack_head -= 1
21173 : */
21174 36542 : while (1) {
21175 36542 : __pyx_t_11 = (__pyx_v_stack_head != 0);
21176 36542 : if (!__pyx_t_11) break;
21177 :
21178 : /* "scipy/sparse/csgraph/_matching.pyx":248
21179 : * while stack_head != 0:
21180 : * # Pop v from stack.
21181 : * stack_head -= 1 # <<<<<<<<<<<<<<
21182 : * v = stack[stack_head]
21183 : * could_augment = False
21184 : */
21185 34878 : __pyx_v_stack_head = (__pyx_v_stack_head - 1);
21186 :
21187 : /* "scipy/sparse/csgraph/_matching.pyx":249
21188 : * # Pop v from stack.
21189 : * stack_head -= 1
21190 : * v = stack[stack_head] # <<<<<<<<<<<<<<
21191 : * could_augment = False
21192 : * for up in range(indptr[v], indptr[v + 1]):
21193 : */
21194 34878 : __pyx_t_12 = __pyx_v_stack_head;
21195 34878 : __pyx_v_v = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_stack.data + __pyx_t_12 * __pyx_v_stack.strides[0]) )));
21196 :
21197 : /* "scipy/sparse/csgraph/_matching.pyx":250
21198 : * stack_head -= 1
21199 : * v = stack[stack_head]
21200 : * could_augment = False # <<<<<<<<<<<<<<
21201 : * for up in range(indptr[v], indptr[v + 1]):
21202 : * u = indices[up]
21203 : */
21204 34878 : __pyx_v_could_augment = 0;
21205 :
21206 : /* "scipy/sparse/csgraph/_matching.pyx":251
21207 : * v = stack[stack_head]
21208 : * could_augment = False
21209 : * for up in range(indptr[v], indptr[v + 1]): # <<<<<<<<<<<<<<
21210 : * u = indices[up]
21211 : * yu = y[u]
21212 : */
21213 34878 : __pyx_t_12 = (__pyx_v_v + 1);
21214 34878 : __pyx_t_15 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_indptr.data + __pyx_t_12 * __pyx_v_indptr.strides[0]) )));
21215 34878 : __pyx_t_12 = __pyx_v_v;
21216 34878 : __pyx_t_16 = __pyx_t_15;
21217 201414 : for (__pyx_t_17 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_indptr.data + __pyx_t_12 * __pyx_v_indptr.strides[0]) ))); __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
21218 176635 : __pyx_v_up = __pyx_t_17;
21219 :
21220 : /* "scipy/sparse/csgraph/_matching.pyx":252
21221 : * could_augment = False
21222 : * for up in range(indptr[v], indptr[v + 1]):
21223 : * u = indices[up] # <<<<<<<<<<<<<<
21224 : * yu = y[u]
21225 : * if dist[yu] == dist[v] + 1:
21226 : */
21227 176635 : __pyx_t_10 = __pyx_v_up;
21228 176635 : __pyx_v_u = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_10 * __pyx_v_indices.strides[0]) )));
21229 :
21230 : /* "scipy/sparse/csgraph/_matching.pyx":253
21231 : * for up in range(indptr[v], indptr[v + 1]):
21232 : * u = indices[up]
21233 : * yu = y[u] # <<<<<<<<<<<<<<
21234 : * if dist[yu] == dist[v] + 1:
21235 : * could_augment = True
21236 : */
21237 176635 : __pyx_t_10 = __pyx_v_u;
21238 176635 : __pyx_v_yu = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_10 * __pyx_v_y.strides[0]) )));
21239 :
21240 : /* "scipy/sparse/csgraph/_matching.pyx":254
21241 : * u = indices[up]
21242 : * yu = y[u]
21243 : * if dist[yu] == dist[v] + 1: # <<<<<<<<<<<<<<
21244 : * could_augment = True
21245 : * # If yu is unmatched, we have found an augmenting
21246 : */
21247 176635 : __pyx_t_10 = __pyx_v_yu;
21248 176635 : __pyx_t_13 = __pyx_v_v;
21249 176635 : __pyx_t_11 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_dist.data + __pyx_t_10 * __pyx_v_dist.strides[0]) ))) == ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_dist.data + __pyx_t_13 * __pyx_v_dist.strides[0]) ))) + 1));
21250 176635 : if (__pyx_t_11) {
21251 :
21252 : /* "scipy/sparse/csgraph/_matching.pyx":255
21253 : * yu = y[u]
21254 : * if dist[yu] == dist[v] + 1:
21255 : * could_augment = True # <<<<<<<<<<<<<<
21256 : * # If yu is unmatched, we have found an augmenting
21257 : * # path. We update the matching and move on to the
21258 : */
21259 38264 : __pyx_v_could_augment = 1;
21260 :
21261 : /* "scipy/sparse/csgraph/_matching.pyx":259
21262 : * # path. We update the matching and move on to the
21263 : * # next unmatched vertex.
21264 : * if yu == i: # <<<<<<<<<<<<<<
21265 : * done = True
21266 : * # Unwind and follow the path back to the root.
21267 : */
21268 38264 : __pyx_t_11 = (__pyx_v_yu == __pyx_v_i);
21269 38264 : if (__pyx_t_11) {
21270 :
21271 : /* "scipy/sparse/csgraph/_matching.pyx":260
21272 : * # next unmatched vertex.
21273 : * if yu == i:
21274 : * done = True # <<<<<<<<<<<<<<
21275 : * # Unwind and follow the path back to the root.
21276 : * while True:
21277 : */
21278 11636 : __pyx_v_done = 1;
21279 :
21280 : /* "scipy/sparse/csgraph/_matching.pyx":262
21281 : * done = True
21282 : * # Unwind and follow the path back to the root.
21283 : * while True: # <<<<<<<<<<<<<<
21284 : * # Mark v as visited to ensure that it
21285 : * # features in only one augmenting path in
21286 : */
21287 13173 : while (1) {
21288 :
21289 : /* "scipy/sparse/csgraph/_matching.pyx":266
21290 : * # features in only one augmenting path in
21291 : * # this sequence of DFS runs.
21292 : * dist[v] = INF # <<<<<<<<<<<<<<
21293 : * u_old = x[v]
21294 : * y[u] = v
21295 : */
21296 11636 : __pyx_t_13 = __pyx_v_v;
21297 11636 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_dist.data + __pyx_t_13 * __pyx_v_dist.strides[0]) )) = __pyx_v_INF;
21298 :
21299 : /* "scipy/sparse/csgraph/_matching.pyx":267
21300 : * # this sequence of DFS runs.
21301 : * dist[v] = INF
21302 : * u_old = x[v] # <<<<<<<<<<<<<<
21303 : * y[u] = v
21304 : * x[v] = u
21305 : */
21306 11636 : __pyx_t_13 = __pyx_v_v;
21307 11636 : __pyx_v_u_old = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_13 * __pyx_v_x.strides[0]) )));
21308 :
21309 : /* "scipy/sparse/csgraph/_matching.pyx":268
21310 : * dist[v] = INF
21311 : * u_old = x[v]
21312 : * y[u] = v # <<<<<<<<<<<<<<
21313 : * x[v] = u
21314 : * u = u_old
21315 : */
21316 11636 : __pyx_t_13 = __pyx_v_u;
21317 11636 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_13 * __pyx_v_y.strides[0]) )) = __pyx_v_v;
21318 :
21319 : /* "scipy/sparse/csgraph/_matching.pyx":269
21320 : * u_old = x[v]
21321 : * y[u] = v
21322 : * x[v] = u # <<<<<<<<<<<<<<
21323 : * u = u_old
21324 : * if v == w:
21325 : */
21326 11636 : __pyx_t_13 = __pyx_v_v;
21327 11636 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_13 * __pyx_v_x.strides[0]) )) = __pyx_v_u;
21328 :
21329 : /* "scipy/sparse/csgraph/_matching.pyx":270
21330 : * y[u] = v
21331 : * x[v] = u
21332 : * u = u_old # <<<<<<<<<<<<<<
21333 : * if v == w:
21334 : * break
21335 : */
21336 11636 : __pyx_v_u = __pyx_v_u_old;
21337 :
21338 : /* "scipy/sparse/csgraph/_matching.pyx":271
21339 : * x[v] = u
21340 : * u = u_old
21341 : * if v == w: # <<<<<<<<<<<<<<
21342 : * break
21343 : * v = parents[v]
21344 : */
21345 11636 : __pyx_t_11 = (__pyx_v_v == __pyx_v_w);
21346 11636 : if (__pyx_t_11) {
21347 :
21348 : /* "scipy/sparse/csgraph/_matching.pyx":272
21349 : * u = u_old
21350 : * if v == w:
21351 : * break # <<<<<<<<<<<<<<
21352 : * v = parents[v]
21353 : * break
21354 : */
21355 10099 : goto __pyx_L29_break;
21356 :
21357 : /* "scipy/sparse/csgraph/_matching.pyx":271
21358 : * x[v] = u
21359 : * u = u_old
21360 : * if v == w: # <<<<<<<<<<<<<<
21361 : * break
21362 : * v = parents[v]
21363 : */
21364 : }
21365 :
21366 : /* "scipy/sparse/csgraph/_matching.pyx":273
21367 : * if v == w:
21368 : * break
21369 : * v = parents[v] # <<<<<<<<<<<<<<
21370 : * break
21371 : * stack[stack_head] = yu
21372 : */
21373 1537 : __pyx_t_13 = __pyx_v_v;
21374 1537 : __pyx_v_v = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_parents.data + __pyx_t_13 * __pyx_v_parents.strides[0]) )));
21375 : }
21376 10099 : __pyx_L29_break:;
21377 :
21378 : /* "scipy/sparse/csgraph/_matching.pyx":274
21379 : * break
21380 : * v = parents[v]
21381 : * break # <<<<<<<<<<<<<<
21382 : * stack[stack_head] = yu
21383 : * stack_head += 1
21384 : */
21385 10099 : goto __pyx_L25_break;
21386 :
21387 : /* "scipy/sparse/csgraph/_matching.pyx":259
21388 : * # path. We update the matching and move on to the
21389 : * # next unmatched vertex.
21390 : * if yu == i: # <<<<<<<<<<<<<<
21391 : * done = True
21392 : * # Unwind and follow the path back to the root.
21393 : */
21394 : }
21395 :
21396 : /* "scipy/sparse/csgraph/_matching.pyx":275
21397 : * v = parents[v]
21398 : * break
21399 : * stack[stack_head] = yu # <<<<<<<<<<<<<<
21400 : * stack_head += 1
21401 : * parents[yu] = v
21402 : */
21403 28165 : __pyx_t_13 = __pyx_v_stack_head;
21404 28165 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_stack.data + __pyx_t_13 * __pyx_v_stack.strides[0]) )) = __pyx_v_yu;
21405 :
21406 : /* "scipy/sparse/csgraph/_matching.pyx":276
21407 : * break
21408 : * stack[stack_head] = yu
21409 : * stack_head += 1 # <<<<<<<<<<<<<<
21410 : * parents[yu] = v
21411 : * if done:
21412 : */
21413 28165 : __pyx_v_stack_head = (__pyx_v_stack_head + 1);
21414 :
21415 : /* "scipy/sparse/csgraph/_matching.pyx":277
21416 : * stack[stack_head] = yu
21417 : * stack_head += 1
21418 : * parents[yu] = v # <<<<<<<<<<<<<<
21419 : * if done:
21420 : * break
21421 : */
21422 28165 : __pyx_t_13 = __pyx_v_yu;
21423 28165 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_parents.data + __pyx_t_13 * __pyx_v_parents.strides[0]) )) = __pyx_v_v;
21424 :
21425 : /* "scipy/sparse/csgraph/_matching.pyx":254
21426 : * u = indices[up]
21427 : * yu = y[u]
21428 : * if dist[yu] == dist[v] + 1: # <<<<<<<<<<<<<<
21429 : * could_augment = True
21430 : * # If yu is unmatched, we have found an augmenting
21431 : */
21432 : }
21433 : }
21434 24779 : __pyx_L25_break:;
21435 :
21436 : /* "scipy/sparse/csgraph/_matching.pyx":278
21437 : * stack_head += 1
21438 : * parents[yu] = v
21439 : * if done: # <<<<<<<<<<<<<<
21440 : * break
21441 : *
21442 : */
21443 34878 : if (__pyx_v_done) {
21444 :
21445 : /* "scipy/sparse/csgraph/_matching.pyx":279
21446 : * parents[yu] = v
21447 : * if done:
21448 : * break # <<<<<<<<<<<<<<
21449 : *
21450 : * for k in range(j):
21451 : */
21452 10099 : goto __pyx_L23_break;
21453 :
21454 : /* "scipy/sparse/csgraph/_matching.pyx":278
21455 : * stack_head += 1
21456 : * parents[yu] = v
21457 : * if done: # <<<<<<<<<<<<<<
21458 : * break
21459 : *
21460 : */
21461 : }
21462 : }
21463 37509 : __pyx_L23_break:;
21464 :
21465 : /* "scipy/sparse/csgraph/_matching.pyx":241
21466 : * # Depth-first search starting from every unmatched vertex.
21467 : * for w in range(i):
21468 : * if x[w] < 0: # <<<<<<<<<<<<<<
21469 : * done = False
21470 : * # Initialize stack to contain only w and reset path.
21471 : */
21472 : }
21473 : }
21474 : }
21475 135 : __pyx_L8_break:;
21476 :
21477 : /* "scipy/sparse/csgraph/_matching.pyx":281
21478 : * break
21479 : *
21480 : * for k in range(j): # <<<<<<<<<<<<<<
21481 : * if y[k] == i:
21482 : * y[k] = -1
21483 : */
21484 135 : __pyx_t_6 = __pyx_v_j;
21485 135 : __pyx_t_8 = __pyx_t_6;
21486 10330 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
21487 10195 : __pyx_v_k = __pyx_t_9;
21488 :
21489 : /* "scipy/sparse/csgraph/_matching.pyx":282
21490 : *
21491 : * for k in range(j):
21492 : * if y[k] == i: # <<<<<<<<<<<<<<
21493 : * y[k] = -1
21494 : *
21495 : */
21496 10195 : __pyx_t_12 = __pyx_v_k;
21497 10195 : __pyx_t_11 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_12 * __pyx_v_y.strides[0]) ))) == __pyx_v_i);
21498 10195 : if (__pyx_t_11) {
21499 :
21500 : /* "scipy/sparse/csgraph/_matching.pyx":283
21501 : * for k in range(j):
21502 : * if y[k] == i:
21503 : * y[k] = -1 # <<<<<<<<<<<<<<
21504 : *
21505 : * return x, y
21506 : */
21507 96 : __pyx_t_12 = __pyx_v_k;
21508 96 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_12 * __pyx_v_y.strides[0]) )) = -1;
21509 :
21510 : /* "scipy/sparse/csgraph/_matching.pyx":282
21511 : *
21512 : * for k in range(j):
21513 : * if y[k] == i: # <<<<<<<<<<<<<<
21514 : * y[k] = -1
21515 : *
21516 : */
21517 : }
21518 : }
21519 :
21520 : /* "scipy/sparse/csgraph/_matching.pyx":285
21521 : * y[k] = -1
21522 : *
21523 : * return x, y # <<<<<<<<<<<<<<
21524 : *
21525 : *
21526 : */
21527 135 : __Pyx_XDECREF(__pyx_r);
21528 135 : __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
21529 135 : __Pyx_GOTREF(__pyx_t_3);
21530 135 : __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_y, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error)
21531 135 : __Pyx_GOTREF(__pyx_t_1);
21532 135 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
21533 135 : __Pyx_GOTREF(__pyx_t_2);
21534 135 : __Pyx_GIVEREF(__pyx_t_3);
21535 135 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error);
21536 135 : __Pyx_GIVEREF(__pyx_t_1);
21537 135 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error);
21538 135 : __pyx_t_3 = 0;
21539 135 : __pyx_t_1 = 0;
21540 135 : __pyx_r = ((PyObject*)__pyx_t_2);
21541 135 : __pyx_t_2 = 0;
21542 135 : goto __pyx_L0;
21543 :
21544 : /* "scipy/sparse/csgraph/_matching.pyx":150
21545 : * @cython.boundscheck(False)
21546 : * @cython.wraparound(False)
21547 : * cdef tuple _hopcroft_karp(const ITYPE_t[:] indices, const ITYPE_t[:] indptr, # <<<<<<<<<<<<<<
21548 : * const ITYPE_t i, const ITYPE_t j):
21549 : * cdef ITYPE_t INF = np.iinfo(ITYPE).max
21550 : */
21551 :
21552 : /* function exit code */
21553 0 : __pyx_L1_error:;
21554 0 : __Pyx_XDECREF(__pyx_t_1);
21555 0 : __Pyx_XDECREF(__pyx_t_2);
21556 0 : __Pyx_XDECREF(__pyx_t_3);
21557 0 : __Pyx_XDECREF(__pyx_t_4);
21558 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
21559 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._matching._hopcroft_karp", __pyx_clineno, __pyx_lineno, __pyx_filename);
21560 0 : __pyx_r = 0;
21561 135 : __pyx_L0:;
21562 135 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
21563 135 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_y, 1);
21564 135 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_dist, 1);
21565 135 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_q, 1);
21566 135 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_stack, 1);
21567 135 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_parents, 1);
21568 135 : __Pyx_XGIVEREF(__pyx_r);
21569 135 : __Pyx_RefNannyFinishContext();
21570 135 : return __pyx_r;
21571 : }
21572 :
21573 : /* "scipy/sparse/csgraph/_matching.pyx":288
21574 : *
21575 : *
21576 : * def min_weight_full_bipartite_matching(biadjacency_matrix, maximize=False): # <<<<<<<<<<<<<<
21577 : * r"""
21578 : * min_weight_full_bipartite_matching(biadjacency_matrix, maximize=False)
21579 : */
21580 :
21581 : /* Python wrapper */
21582 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_9_matching_3min_weight_full_bipartite_matching(PyObject *__pyx_self,
21583 : #if CYTHON_METH_FASTCALL
21584 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21585 : #else
21586 : PyObject *__pyx_args, PyObject *__pyx_kwds
21587 : #endif
21588 : ); /*proto*/
21589 : PyDoc_STRVAR(__pyx_doc_5scipy_6sparse_7csgraph_9_matching_2min_weight_full_bipartite_matching, "\n min_weight_full_bipartite_matching(biadjacency_matrix, maximize=False)\n\n Returns the minimum weight full matching of a bipartite graph.\n\n .. versionadded:: 1.6.0\n\n Parameters\n ----------\n biadjacency_matrix : sparse matrix\n Biadjacency matrix of the bipartite graph: A sparse matrix in CSR, CSC,\n or COO format whose rows represent one partition of the graph and whose\n columns represent the other partition. An edge between two vertices is\n indicated by the corresponding entry in the matrix, and the weight of\n the edge is given by the value of that entry. This should not be\n confused with the full adjacency matrix of the graph, as we only need\n the submatrix defining the bipartite structure.\n\n maximize : bool (default: False)\n Calculates a maximum weight matching if true.\n\n Returns\n -------\n row_ind, col_ind : array\n An array of row indices and one of corresponding column indices giving\n the optimal matching. The total weight of the matching can be computed\n as ``graph[row_ind, col_ind].sum()``. The row indices will be\n sorted; in the case of a square matrix they will be equal to\n ``numpy.arange(graph.shape[0])``.\n\n Notes\n -----\n\n Let :math:`G = ((U, V), E)` be a weighted bipartite graph with non-zero\n weights :math:`w : E \\to \\mathbb{R} \\setminus \\{0\\}`. This function then\n produces a matching :math:`M \\subseteq E` with cardinality\n\n .. math::\n \\lvert M \\rvert = \\min(\\lvert U \\rvert, \\lvert V \\rvert),\n\n which minimizes the sum of the weights of the edges included in the\n matching, :math:`\\sum_{e \\in M} w(e)`, or raises an error if no such\n matching exists.\n\n When :math:`\\lvert U \\rvert = \\lvert V \\rvert`, this is commonly\n referred to as a perfect matching; here, since we allow\n :math:`\\lvert U \\rvert` and :math:`\\lvert V \\rvert` to diffe""r, we\n follow Karp [1]_ and refer to the matching as *full*.\n\n This function implements the LAPJVsp algorithm [2]_, short for \"Linear\n assignment problem, Jonker--Volgenant, sparse\".\n\n The problem it solves is equivalent to the rectangular linear assignment\n problem. [3]_ As such, this function can be used to solve the same problems\n as :func:`scipy.optimize.linear_sum_assignment`. That function may perform\n better when the input is dense, or for certain particular types of inputs,\n such as those for which the :math:`(i, j)`'th entry is the distance between\n two points in Euclidean space.\n\n If no full matching exists, this function raises a ``ValueError``. For\n determining the size of the largest matching in the graph, see\n :func:`maximum_bipartite_matching`.\n\n We require that weights are non-zero only to avoid issues with the handling\n of explicit zeros when converting between different sparse representations.\n Zero weights can be handled by adding a constant to all weights, so that\n the resulting matrix contains no zeros.\n\n If multiple valid solutions are possible, output may vary with SciPy and\n Python version.\n\n References\n ----------\n .. [1] Richard Manning Karp:\n An algorithm to Solve the m x n Assignment Problem in Expected Time\n O(mn log n).\n Networks, 10(2):143-152, 1980.\n .. [2] Roy Jonker and Anton Volgenant:\n A Shortest Augmenting Path Algorithm for Dense and Sparse Linear\n Assignment Problems.\n Computing 38:325-340, 1987.\n .. [3] https://en.wikipedia.org/wiki/Assignment_problem\n\n Examples\n --------\n >>> from scipy.sparse import csr_matrix\n >>> from scipy.sparse.csgraph import min_weight_full_bipartite_matching\n\n Let us first consider an example in which all weights are equal:\n\n >>> biadjacency_matrix = csr_matrix([[1, 1, 1], [1, 0, 0], [0, 1, 0]])\n\n Here, all we get is a perfect mat""ching of the graph:\n\n >>> print(min_weight_full_bipartite_matching(biadjacency_matrix)[1])\n [2 0 1]\n\n That is, the first, second, and third rows are matched with the third,\n first, and second column respectively. Note that in this example, the 0\n in the input matrix does *not* correspond to an edge with weight 0, but\n rather a pair of vertices not paired by an edge.\n\n Note also that in this case, the output matches the result of applying\n :func:`maximum_bipartite_matching`:\n\n >>> from scipy.sparse.csgraph import maximum_bipartite_matching\n >>> biadjacency = csr_matrix([[1, 1, 1], [1, 0, 0], [0, 1, 0]])\n >>> print(maximum_bipartite_matching(biadjacency, perm_type='column'))\n [2 0 1]\n\n When multiple edges are available, the ones with lowest weights are\n preferred:\n\n >>> biadjacency = csr_matrix([[3, 3, 6], [4, 3, 5], [10, 1, 8]])\n >>> row_ind, col_ind = min_weight_full_bipartite_matching(biadjacency)\n >>> print(col_ind)\n [0 2 1]\n\n The total weight in this case is :math:`3 + 5 + 1 = 9`:\n\n >>> print(biadjacency[row_ind, col_ind].sum())\n 9\n\n When the matrix is not square, i.e. when the two partitions have different\n cardinalities, the matching is as large as the smaller of the two\n partitions:\n\n >>> biadjacency = csr_matrix([[0, 1, 1], [0, 2, 3]])\n >>> row_ind, col_ind = min_weight_full_bipartite_matching(biadjacency)\n >>> print(row_ind, col_ind)\n [0 1] [2 1]\n >>> biadjacency = csr_matrix([[0, 1], [3, 1], [1, 4]])\n >>> row_ind, col_ind = min_weight_full_bipartite_matching(biadjacency)\n >>> print(row_ind, col_ind)\n [0 2] [1 0]\n\n When one or both of the partitions are empty, the matching is empty as\n well:\n\n >>> biadjacency = csr_matrix((2, 0))\n >>> row_ind, col_ind = min_weight_full_bipartite_matching(biadjacency)\n >>> print(row_ind, col_ind)\n [] []\n\n In general, we will always reach the same sum of weight""s as if we had used\n :func:`scipy.optimize.linear_sum_assignment` but note that for that one,\n missing edges are represented by a matrix entry of ``float('inf')``. Let us\n generate a random sparse matrix with integer entries between 1 and 10:\n\n >>> import numpy as np\n >>> from scipy.sparse import random\n >>> from scipy.optimize import linear_sum_assignment\n >>> sparse = random(10, 10, random_state=42, density=.5, format='coo') * 10\n >>> sparse.data = np.ceil(sparse.data)\n >>> dense = sparse.toarray()\n >>> dense = np.full(sparse.shape, np.inf)\n >>> dense[sparse.row, sparse.col] = sparse.data\n >>> sparse = sparse.tocsr()\n >>> row_ind, col_ind = linear_sum_assignment(dense)\n >>> print(dense[row_ind, col_ind].sum())\n 28.0\n >>> row_ind, col_ind = min_weight_full_bipartite_matching(sparse)\n >>> print(sparse[row_ind, col_ind].sum())\n 28.0\n\n ");
21590 : static PyMethodDef __pyx_mdef_5scipy_6sparse_7csgraph_9_matching_3min_weight_full_bipartite_matching = {"min_weight_full_bipartite_matching", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6sparse_7csgraph_9_matching_3min_weight_full_bipartite_matching, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6sparse_7csgraph_9_matching_2min_weight_full_bipartite_matching};
21591 111 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_9_matching_3min_weight_full_bipartite_matching(PyObject *__pyx_self,
21592 : #if CYTHON_METH_FASTCALL
21593 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21594 : #else
21595 : PyObject *__pyx_args, PyObject *__pyx_kwds
21596 : #endif
21597 : ) {
21598 111 : PyObject *__pyx_v_biadjacency_matrix = 0;
21599 111 : PyObject *__pyx_v_maximize = 0;
21600 : #if !CYTHON_METH_FASTCALL
21601 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21602 : #endif
21603 111 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21604 111 : PyObject* values[2] = {0,0};
21605 111 : int __pyx_lineno = 0;
21606 111 : const char *__pyx_filename = NULL;
21607 111 : int __pyx_clineno = 0;
21608 111 : PyObject *__pyx_r = 0;
21609 : __Pyx_RefNannyDeclarations
21610 111 : __Pyx_RefNannySetupContext("min_weight_full_bipartite_matching (wrapper)", 0);
21611 : #if !CYTHON_METH_FASTCALL
21612 : #if CYTHON_ASSUME_SAFE_MACROS
21613 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21614 : #else
21615 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21616 : #endif
21617 : #endif
21618 111 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21619 : {
21620 111 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_biadjacency_matrix,&__pyx_n_s_maximize,0};
21621 111 : values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
21622 111 : if (__pyx_kwds) {
21623 0 : Py_ssize_t kw_args;
21624 0 : switch (__pyx_nargs) {
21625 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
21626 0 : CYTHON_FALLTHROUGH;
21627 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
21628 0 : CYTHON_FALLTHROUGH;
21629 0 : case 0: break;
21630 0 : default: goto __pyx_L5_argtuple_error;
21631 : }
21632 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
21633 0 : switch (__pyx_nargs) {
21634 : case 0:
21635 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_biadjacency_matrix)) != 0)) {
21636 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
21637 0 : kw_args--;
21638 : }
21639 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error)
21640 0 : else goto __pyx_L5_argtuple_error;
21641 0 : CYTHON_FALLTHROUGH;
21642 : case 1:
21643 0 : if (kw_args > 0) {
21644 0 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maximize);
21645 0 : if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
21646 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error)
21647 : }
21648 : }
21649 0 : if (unlikely(kw_args > 0)) {
21650 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
21651 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "min_weight_full_bipartite_matching") < 0)) __PYX_ERR(0, 288, __pyx_L3_error)
21652 : }
21653 : } else {
21654 111 : switch (__pyx_nargs) {
21655 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
21656 111 : CYTHON_FALLTHROUGH;
21657 111 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
21658 111 : break;
21659 0 : default: goto __pyx_L5_argtuple_error;
21660 : }
21661 : }
21662 111 : __pyx_v_biadjacency_matrix = values[0];
21663 111 : __pyx_v_maximize = values[1];
21664 : }
21665 111 : goto __pyx_L6_skip;
21666 0 : __pyx_L5_argtuple_error:;
21667 0 : __Pyx_RaiseArgtupleInvalid("min_weight_full_bipartite_matching", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 288, __pyx_L3_error)
21668 111 : __pyx_L6_skip:;
21669 111 : goto __pyx_L4_argument_unpacking_done;
21670 0 : __pyx_L3_error:;
21671 : {
21672 0 : Py_ssize_t __pyx_temp;
21673 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21674 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
21675 : }
21676 : }
21677 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._matching.min_weight_full_bipartite_matching", __pyx_clineno, __pyx_lineno, __pyx_filename);
21678 0 : __Pyx_RefNannyFinishContext();
21679 0 : return NULL;
21680 111 : __pyx_L4_argument_unpacking_done:;
21681 111 : __pyx_r = __pyx_pf_5scipy_6sparse_7csgraph_9_matching_2min_weight_full_bipartite_matching(__pyx_self, __pyx_v_biadjacency_matrix, __pyx_v_maximize);
21682 :
21683 : /* function exit code */
21684 : {
21685 111 : Py_ssize_t __pyx_temp;
21686 111 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21687 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
21688 : }
21689 : }
21690 : __Pyx_RefNannyFinishContext();
21691 : return __pyx_r;
21692 : }
21693 :
21694 111 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_9_matching_2min_weight_full_bipartite_matching(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_biadjacency_matrix, PyObject *__pyx_v_maximize) {
21695 111 : PyObject *__pyx_v_i = NULL;
21696 111 : PyObject *__pyx_v_j = NULL;
21697 111 : PyObject *__pyx_v_a = NULL;
21698 111 : PyObject *__pyx_v_biadjacency_matrix_t = NULL;
21699 111 : PyObject *__pyx_v_matching = NULL;
21700 111 : CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
21701 111 : PyObject *__pyx_v_b = NULL;
21702 111 : PyObject *__pyx_v_indices = NULL;
21703 111 : PyObject *__pyx_r = NULL;
21704 : __Pyx_RefNannyDeclarations
21705 111 : PyObject *__pyx_t_1 = NULL;
21706 111 : PyObject *__pyx_t_2 = NULL;
21707 111 : PyObject *__pyx_t_3 = NULL;
21708 111 : unsigned int __pyx_t_4;
21709 111 : int __pyx_t_5;
21710 111 : int __pyx_t_6;
21711 111 : PyObject *__pyx_t_7 = NULL;
21712 111 : PyObject *__pyx_t_8 = NULL;
21713 111 : PyObject *(*__pyx_t_9)(PyObject *);
21714 111 : PyObject *__pyx_t_10 = NULL;
21715 111 : __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
21716 111 : __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
21717 111 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_13;
21718 111 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_14;
21719 111 : __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
21720 111 : __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } };
21721 111 : __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } };
21722 111 : __Pyx_memviewslice __pyx_t_18 = { 0, 0, { 0 }, { 0 }, { 0 } };
21723 111 : int __pyx_lineno = 0;
21724 111 : const char *__pyx_filename = NULL;
21725 111 : int __pyx_clineno = 0;
21726 111 : __Pyx_RefNannySetupContext("min_weight_full_bipartite_matching", 0);
21727 111 : __Pyx_INCREF(__pyx_v_biadjacency_matrix);
21728 :
21729 : /* "scipy/sparse/csgraph/_matching.pyx":455
21730 : *
21731 : * """
21732 : * biadjacency_matrix = convert_pydata_sparse_to_scipy(biadjacency_matrix) # <<<<<<<<<<<<<<
21733 : * if not issparse(biadjacency_matrix):
21734 : * raise TypeError("graph must be sparse")
21735 : */
21736 111 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_convert_pydata_sparse_to_scipy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error)
21737 111 : __Pyx_GOTREF(__pyx_t_2);
21738 111 : __pyx_t_3 = NULL;
21739 111 : __pyx_t_4 = 0;
21740 : #if CYTHON_UNPACK_METHODS
21741 111 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
21742 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
21743 0 : if (likely(__pyx_t_3)) {
21744 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21745 0 : __Pyx_INCREF(__pyx_t_3);
21746 0 : __Pyx_INCREF(function);
21747 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
21748 : __pyx_t_4 = 1;
21749 : }
21750 : }
21751 : #endif
21752 : {
21753 111 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_biadjacency_matrix};
21754 111 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
21755 111 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21756 111 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
21757 111 : __Pyx_GOTREF(__pyx_t_1);
21758 111 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21759 : }
21760 111 : __Pyx_DECREF_SET(__pyx_v_biadjacency_matrix, __pyx_t_1);
21761 111 : __pyx_t_1 = 0;
21762 :
21763 : /* "scipy/sparse/csgraph/_matching.pyx":456
21764 : * """
21765 : * biadjacency_matrix = convert_pydata_sparse_to_scipy(biadjacency_matrix)
21766 : * if not issparse(biadjacency_matrix): # <<<<<<<<<<<<<<
21767 : * raise TypeError("graph must be sparse")
21768 : * if biadjacency_matrix.format not in ("csr", "csc", "coo"):
21769 : */
21770 111 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_issparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
21771 111 : __Pyx_GOTREF(__pyx_t_2);
21772 111 : __pyx_t_3 = NULL;
21773 111 : __pyx_t_4 = 0;
21774 : #if CYTHON_UNPACK_METHODS
21775 111 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
21776 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
21777 0 : if (likely(__pyx_t_3)) {
21778 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21779 0 : __Pyx_INCREF(__pyx_t_3);
21780 0 : __Pyx_INCREF(function);
21781 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
21782 : __pyx_t_4 = 1;
21783 : }
21784 : }
21785 : #endif
21786 : {
21787 111 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_biadjacency_matrix};
21788 111 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
21789 111 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21790 111 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
21791 111 : __Pyx_GOTREF(__pyx_t_1);
21792 111 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21793 : }
21794 111 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 456, __pyx_L1_error)
21795 111 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21796 111 : __pyx_t_6 = (!__pyx_t_5);
21797 111 : if (unlikely(__pyx_t_6)) {
21798 :
21799 : /* "scipy/sparse/csgraph/_matching.pyx":457
21800 : * biadjacency_matrix = convert_pydata_sparse_to_scipy(biadjacency_matrix)
21801 : * if not issparse(biadjacency_matrix):
21802 : * raise TypeError("graph must be sparse") # <<<<<<<<<<<<<<
21803 : * if biadjacency_matrix.format not in ("csr", "csc", "coo"):
21804 : * raise TypeError("graph must be in CSC, CSR, or COO format.")
21805 : */
21806 0 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
21807 0 : __Pyx_GOTREF(__pyx_t_1);
21808 0 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
21809 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21810 0 : __PYX_ERR(0, 457, __pyx_L1_error)
21811 :
21812 : /* "scipy/sparse/csgraph/_matching.pyx":456
21813 : * """
21814 : * biadjacency_matrix = convert_pydata_sparse_to_scipy(biadjacency_matrix)
21815 : * if not issparse(biadjacency_matrix): # <<<<<<<<<<<<<<
21816 : * raise TypeError("graph must be sparse")
21817 : * if biadjacency_matrix.format not in ("csr", "csc", "coo"):
21818 : */
21819 : }
21820 :
21821 : /* "scipy/sparse/csgraph/_matching.pyx":458
21822 : * if not issparse(biadjacency_matrix):
21823 : * raise TypeError("graph must be sparse")
21824 : * if biadjacency_matrix.format not in ("csr", "csc", "coo"): # <<<<<<<<<<<<<<
21825 : * raise TypeError("graph must be in CSC, CSR, or COO format.")
21826 : *
21827 : */
21828 111 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
21829 111 : __Pyx_GOTREF(__pyx_t_1);
21830 111 : __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_csr, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 458, __pyx_L1_error)
21831 111 : if (__pyx_t_5) {
21832 0 : } else {
21833 111 : __pyx_t_6 = __pyx_t_5;
21834 111 : goto __pyx_L5_bool_binop_done;
21835 : }
21836 0 : __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_csc, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 458, __pyx_L1_error)
21837 0 : if (__pyx_t_5) {
21838 0 : } else {
21839 0 : __pyx_t_6 = __pyx_t_5;
21840 0 : goto __pyx_L5_bool_binop_done;
21841 : }
21842 0 : __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_coo, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 458, __pyx_L1_error)
21843 : __pyx_t_6 = __pyx_t_5;
21844 111 : __pyx_L5_bool_binop_done:;
21845 111 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21846 111 : __pyx_t_5 = __pyx_t_6;
21847 111 : if (unlikely(__pyx_t_5)) {
21848 :
21849 : /* "scipy/sparse/csgraph/_matching.pyx":459
21850 : * raise TypeError("graph must be sparse")
21851 : * if biadjacency_matrix.format not in ("csr", "csc", "coo"):
21852 : * raise TypeError("graph must be in CSC, CSR, or COO format.") # <<<<<<<<<<<<<<
21853 : *
21854 : * if not (np.issubdtype(biadjacency_matrix.dtype, np.number) or
21855 : */
21856 0 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
21857 0 : __Pyx_GOTREF(__pyx_t_1);
21858 0 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
21859 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21860 0 : __PYX_ERR(0, 459, __pyx_L1_error)
21861 :
21862 : /* "scipy/sparse/csgraph/_matching.pyx":458
21863 : * if not issparse(biadjacency_matrix):
21864 : * raise TypeError("graph must be sparse")
21865 : * if biadjacency_matrix.format not in ("csr", "csc", "coo"): # <<<<<<<<<<<<<<
21866 : * raise TypeError("graph must be in CSC, CSR, or COO format.")
21867 : *
21868 : */
21869 : }
21870 :
21871 : /* "scipy/sparse/csgraph/_matching.pyx":461
21872 : * raise TypeError("graph must be in CSC, CSR, or COO format.")
21873 : *
21874 : * if not (np.issubdtype(biadjacency_matrix.dtype, np.number) or # <<<<<<<<<<<<<<
21875 : * biadjacency_matrix.dtype == np.dtype(np.bool_)):
21876 : * raise ValueError("expected a matrix containing numerical entries, " +
21877 : */
21878 111 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
21879 111 : __Pyx_GOTREF(__pyx_t_2);
21880 111 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_issubdtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error)
21881 111 : __Pyx_GOTREF(__pyx_t_3);
21882 111 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21883 111 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
21884 111 : __Pyx_GOTREF(__pyx_t_2);
21885 111 : __pyx_t_7 = NULL;
21886 111 : __pyx_t_4 = 0;
21887 : #if CYTHON_UNPACK_METHODS
21888 111 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
21889 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
21890 0 : if (likely(__pyx_t_7)) {
21891 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
21892 0 : __Pyx_INCREF(__pyx_t_7);
21893 0 : __Pyx_INCREF(function);
21894 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
21895 : __pyx_t_4 = 1;
21896 : }
21897 : }
21898 : #endif
21899 : {
21900 111 : PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_2, ((PyObject *)__pyx_ptype_5numpy_number)};
21901 111 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
21902 111 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
21903 111 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21904 111 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
21905 111 : __Pyx_GOTREF(__pyx_t_1);
21906 111 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21907 : }
21908 111 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 461, __pyx_L1_error)
21909 111 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21910 111 : if (!__pyx_t_6) {
21911 0 : } else {
21912 111 : __pyx_t_5 = __pyx_t_6;
21913 111 : goto __pyx_L9_bool_binop_done;
21914 : }
21915 :
21916 : /* "scipy/sparse/csgraph/_matching.pyx":462
21917 : *
21918 : * if not (np.issubdtype(biadjacency_matrix.dtype, np.number) or
21919 : * biadjacency_matrix.dtype == np.dtype(np.bool_)): # <<<<<<<<<<<<<<
21920 : * raise ValueError("expected a matrix containing numerical entries, " +
21921 : * "got %s" % (biadjacency_matrix.dtype,))
21922 : */
21923 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
21924 0 : __Pyx_GOTREF(__pyx_t_1);
21925 0 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __pyx_L1_error)
21926 0 : __Pyx_GOTREF(__pyx_t_3);
21927 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bool); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
21928 0 : __Pyx_GOTREF(__pyx_t_2);
21929 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21930 0 : __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __pyx_L1_error)
21931 0 : __Pyx_GOTREF(__pyx_t_3);
21932 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21933 0 : __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
21934 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21935 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21936 0 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 462, __pyx_L1_error)
21937 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21938 : __pyx_t_5 = __pyx_t_6;
21939 111 : __pyx_L9_bool_binop_done:;
21940 :
21941 : /* "scipy/sparse/csgraph/_matching.pyx":461
21942 : * raise TypeError("graph must be in CSC, CSR, or COO format.")
21943 : *
21944 : * if not (np.issubdtype(biadjacency_matrix.dtype, np.number) or # <<<<<<<<<<<<<<
21945 : * biadjacency_matrix.dtype == np.dtype(np.bool_)):
21946 : * raise ValueError("expected a matrix containing numerical entries, " +
21947 : */
21948 111 : __pyx_t_6 = (!__pyx_t_5);
21949 111 : if (unlikely(__pyx_t_6)) {
21950 :
21951 : /* "scipy/sparse/csgraph/_matching.pyx":464
21952 : * biadjacency_matrix.dtype == np.dtype(np.bool_)):
21953 : * raise ValueError("expected a matrix containing numerical entries, " +
21954 : * "got %s" % (biadjacency_matrix.dtype,)) # <<<<<<<<<<<<<<
21955 : *
21956 : * biadjacency_matrix = biadjacency_matrix.astype(np.double)
21957 : */
21958 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
21959 0 : __Pyx_GOTREF(__pyx_t_2);
21960 0 : __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error)
21961 0 : __Pyx_GOTREF(__pyx_t_3);
21962 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21963 0 : __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_got_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
21964 0 : __Pyx_GOTREF(__pyx_t_2);
21965 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21966 :
21967 : /* "scipy/sparse/csgraph/_matching.pyx":463
21968 : * if not (np.issubdtype(biadjacency_matrix.dtype, np.number) or
21969 : * biadjacency_matrix.dtype == np.dtype(np.bool_)):
21970 : * raise ValueError("expected a matrix containing numerical entries, " + # <<<<<<<<<<<<<<
21971 : * "got %s" % (biadjacency_matrix.dtype,))
21972 : *
21973 : */
21974 0 : __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_expected_a_matrix_containing_num, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
21975 0 : __Pyx_GOTREF(__pyx_t_3);
21976 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21977 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
21978 0 : __Pyx_GOTREF(__pyx_t_2);
21979 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21980 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
21981 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21982 0 : __PYX_ERR(0, 463, __pyx_L1_error)
21983 :
21984 : /* "scipy/sparse/csgraph/_matching.pyx":461
21985 : * raise TypeError("graph must be in CSC, CSR, or COO format.")
21986 : *
21987 : * if not (np.issubdtype(biadjacency_matrix.dtype, np.number) or # <<<<<<<<<<<<<<
21988 : * biadjacency_matrix.dtype == np.dtype(np.bool_)):
21989 : * raise ValueError("expected a matrix containing numerical entries, " +
21990 : */
21991 : }
21992 :
21993 : /* "scipy/sparse/csgraph/_matching.pyx":466
21994 : * "got %s" % (biadjacency_matrix.dtype,))
21995 : *
21996 : * biadjacency_matrix = biadjacency_matrix.astype(np.double) # <<<<<<<<<<<<<<
21997 : *
21998 : * if maximize:
21999 : */
22000 111 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
22001 111 : __Pyx_GOTREF(__pyx_t_3);
22002 111 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error)
22003 111 : __Pyx_GOTREF(__pyx_t_1);
22004 111 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L1_error)
22005 111 : __Pyx_GOTREF(__pyx_t_7);
22006 111 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22007 111 : __pyx_t_1 = NULL;
22008 111 : __pyx_t_4 = 0;
22009 : #if CYTHON_UNPACK_METHODS
22010 111 : if (likely(PyMethod_Check(__pyx_t_3))) {
22011 111 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
22012 111 : if (likely(__pyx_t_1)) {
22013 111 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
22014 111 : __Pyx_INCREF(__pyx_t_1);
22015 111 : __Pyx_INCREF(function);
22016 111 : __Pyx_DECREF_SET(__pyx_t_3, function);
22017 : __pyx_t_4 = 1;
22018 : }
22019 : }
22020 : #endif
22021 : {
22022 111 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_7};
22023 111 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
22024 111 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22025 111 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22026 111 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error)
22027 111 : __Pyx_GOTREF(__pyx_t_2);
22028 111 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22029 : }
22030 111 : __Pyx_DECREF_SET(__pyx_v_biadjacency_matrix, __pyx_t_2);
22031 111 : __pyx_t_2 = 0;
22032 :
22033 : /* "scipy/sparse/csgraph/_matching.pyx":468
22034 : * biadjacency_matrix = biadjacency_matrix.astype(np.double)
22035 : *
22036 : * if maximize: # <<<<<<<<<<<<<<
22037 : * biadjacency_matrix = -biadjacency_matrix
22038 : *
22039 : */
22040 111 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_maximize); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 468, __pyx_L1_error)
22041 111 : if (__pyx_t_6) {
22042 :
22043 : /* "scipy/sparse/csgraph/_matching.pyx":469
22044 : *
22045 : * if maximize:
22046 : * biadjacency_matrix = -biadjacency_matrix # <<<<<<<<<<<<<<
22047 : *
22048 : * # Change all infinities to zeros, then remove those zeros, but warn the
22049 : */
22050 0 : __pyx_t_2 = PyNumber_Negative(__pyx_v_biadjacency_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error)
22051 0 : __Pyx_GOTREF(__pyx_t_2);
22052 0 : __Pyx_DECREF_SET(__pyx_v_biadjacency_matrix, __pyx_t_2);
22053 : __pyx_t_2 = 0;
22054 :
22055 : /* "scipy/sparse/csgraph/_matching.pyx":468
22056 : * biadjacency_matrix = biadjacency_matrix.astype(np.double)
22057 : *
22058 : * if maximize: # <<<<<<<<<<<<<<
22059 : * biadjacency_matrix = -biadjacency_matrix
22060 : *
22061 : */
22062 : }
22063 :
22064 : /* "scipy/sparse/csgraph/_matching.pyx":473
22065 : * # Change all infinities to zeros, then remove those zeros, but warn the
22066 : * # user if any zeros were present in the first place.
22067 : * if not np.all(biadjacency_matrix.data): # <<<<<<<<<<<<<<
22068 : * warnings.warn('explicit zero weights are removed before matching')
22069 : *
22070 : */
22071 111 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error)
22072 111 : __Pyx_GOTREF(__pyx_t_3);
22073 111 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_all); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 473, __pyx_L1_error)
22074 111 : __Pyx_GOTREF(__pyx_t_7);
22075 111 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22076 111 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error)
22077 111 : __Pyx_GOTREF(__pyx_t_3);
22078 111 : __pyx_t_1 = NULL;
22079 111 : __pyx_t_4 = 0;
22080 : #if CYTHON_UNPACK_METHODS
22081 111 : if (unlikely(PyMethod_Check(__pyx_t_7))) {
22082 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
22083 0 : if (likely(__pyx_t_1)) {
22084 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
22085 0 : __Pyx_INCREF(__pyx_t_1);
22086 0 : __Pyx_INCREF(function);
22087 0 : __Pyx_DECREF_SET(__pyx_t_7, function);
22088 : __pyx_t_4 = 1;
22089 : }
22090 : }
22091 : #endif
22092 : {
22093 111 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3};
22094 111 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
22095 111 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22096 111 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22097 111 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error)
22098 111 : __Pyx_GOTREF(__pyx_t_2);
22099 111 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22100 : }
22101 111 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 473, __pyx_L1_error)
22102 111 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22103 111 : __pyx_t_5 = (!__pyx_t_6);
22104 111 : if (__pyx_t_5) {
22105 :
22106 : /* "scipy/sparse/csgraph/_matching.pyx":474
22107 : * # user if any zeros were present in the first place.
22108 : * if not np.all(biadjacency_matrix.data):
22109 : * warnings.warn('explicit zero weights are removed before matching') # <<<<<<<<<<<<<<
22110 : *
22111 : * biadjacency_matrix.data[np.isposinf(biadjacency_matrix.data)] = 0
22112 : */
22113 1 : __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_warnings); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L1_error)
22114 1 : __Pyx_GOTREF(__pyx_t_7);
22115 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error)
22116 1 : __Pyx_GOTREF(__pyx_t_3);
22117 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22118 1 : __pyx_t_7 = NULL;
22119 1 : __pyx_t_4 = 0;
22120 : #if CYTHON_UNPACK_METHODS
22121 1 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
22122 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
22123 0 : if (likely(__pyx_t_7)) {
22124 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
22125 0 : __Pyx_INCREF(__pyx_t_7);
22126 0 : __Pyx_INCREF(function);
22127 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
22128 : __pyx_t_4 = 1;
22129 : }
22130 : }
22131 : #endif
22132 : {
22133 1 : PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u_explicit_zero_weights_are_remove};
22134 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
22135 1 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22136 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
22137 1 : __Pyx_GOTREF(__pyx_t_2);
22138 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22139 : }
22140 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22141 :
22142 : /* "scipy/sparse/csgraph/_matching.pyx":473
22143 : * # Change all infinities to zeros, then remove those zeros, but warn the
22144 : * # user if any zeros were present in the first place.
22145 : * if not np.all(biadjacency_matrix.data): # <<<<<<<<<<<<<<
22146 : * warnings.warn('explicit zero weights are removed before matching')
22147 : *
22148 : */
22149 : }
22150 :
22151 : /* "scipy/sparse/csgraph/_matching.pyx":476
22152 : * warnings.warn('explicit zero weights are removed before matching')
22153 : *
22154 : * biadjacency_matrix.data[np.isposinf(biadjacency_matrix.data)] = 0 # <<<<<<<<<<<<<<
22155 : * biadjacency_matrix.eliminate_zeros()
22156 : *
22157 : */
22158 111 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error)
22159 111 : __Pyx_GOTREF(__pyx_t_2);
22160 111 : __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 476, __pyx_L1_error)
22161 111 : __Pyx_GOTREF(__pyx_t_7);
22162 111 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_isposinf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
22163 111 : __Pyx_GOTREF(__pyx_t_1);
22164 111 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22165 111 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 476, __pyx_L1_error)
22166 111 : __Pyx_GOTREF(__pyx_t_7);
22167 111 : __pyx_t_8 = NULL;
22168 111 : __pyx_t_4 = 0;
22169 : #if CYTHON_UNPACK_METHODS
22170 111 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
22171 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
22172 0 : if (likely(__pyx_t_8)) {
22173 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
22174 0 : __Pyx_INCREF(__pyx_t_8);
22175 0 : __Pyx_INCREF(function);
22176 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
22177 : __pyx_t_4 = 1;
22178 : }
22179 : }
22180 : #endif
22181 : {
22182 111 : PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
22183 111 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
22184 111 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22185 111 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22186 111 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error)
22187 111 : __Pyx_GOTREF(__pyx_t_3);
22188 111 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22189 : }
22190 111 : if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_int_0) < 0))) __PYX_ERR(0, 476, __pyx_L1_error)
22191 111 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22192 111 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22193 :
22194 : /* "scipy/sparse/csgraph/_matching.pyx":477
22195 : *
22196 : * biadjacency_matrix.data[np.isposinf(biadjacency_matrix.data)] = 0
22197 : * biadjacency_matrix.eliminate_zeros() # <<<<<<<<<<<<<<
22198 : *
22199 : * i, j = biadjacency_matrix.shape
22200 : */
22201 111 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_eliminate_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
22202 111 : __Pyx_GOTREF(__pyx_t_2);
22203 111 : __pyx_t_1 = NULL;
22204 111 : __pyx_t_4 = 0;
22205 : #if CYTHON_UNPACK_METHODS
22206 111 : if (likely(PyMethod_Check(__pyx_t_2))) {
22207 111 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
22208 111 : if (likely(__pyx_t_1)) {
22209 111 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
22210 111 : __Pyx_INCREF(__pyx_t_1);
22211 111 : __Pyx_INCREF(function);
22212 111 : __Pyx_DECREF_SET(__pyx_t_2, function);
22213 : __pyx_t_4 = 1;
22214 : }
22215 : }
22216 : #endif
22217 : {
22218 111 : PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
22219 111 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
22220 111 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22221 111 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 477, __pyx_L1_error)
22222 111 : __Pyx_GOTREF(__pyx_t_3);
22223 111 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22224 : }
22225 111 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22226 :
22227 : /* "scipy/sparse/csgraph/_matching.pyx":479
22228 : * biadjacency_matrix.eliminate_zeros()
22229 : *
22230 : * i, j = biadjacency_matrix.shape # <<<<<<<<<<<<<<
22231 : *
22232 : * a = np.arange(np.min(biadjacency_matrix.shape))
22233 : */
22234 111 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error)
22235 111 : __Pyx_GOTREF(__pyx_t_3);
22236 111 : if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
22237 111 : PyObject* sequence = __pyx_t_3;
22238 111 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
22239 111 : if (unlikely(size != 2)) {
22240 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
22241 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
22242 0 : __PYX_ERR(0, 479, __pyx_L1_error)
22243 : }
22244 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22245 111 : if (likely(PyTuple_CheckExact(sequence))) {
22246 111 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
22247 111 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
22248 : } else {
22249 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
22250 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
22251 : }
22252 111 : __Pyx_INCREF(__pyx_t_2);
22253 111 : __Pyx_INCREF(__pyx_t_1);
22254 : #else
22255 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error)
22256 : __Pyx_GOTREF(__pyx_t_2);
22257 : __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error)
22258 : __Pyx_GOTREF(__pyx_t_1);
22259 : #endif
22260 111 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22261 : } else {
22262 0 : Py_ssize_t index = -1;
22263 0 : __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 479, __pyx_L1_error)
22264 0 : __Pyx_GOTREF(__pyx_t_7);
22265 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22266 0 : __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
22267 0 : index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L13_unpacking_failed;
22268 0 : __Pyx_GOTREF(__pyx_t_2);
22269 0 : index = 1; __pyx_t_1 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L13_unpacking_failed;
22270 0 : __Pyx_GOTREF(__pyx_t_1);
22271 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_7), 2) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
22272 0 : __pyx_t_9 = NULL;
22273 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22274 0 : goto __pyx_L14_unpacking_done;
22275 0 : __pyx_L13_unpacking_failed:;
22276 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22277 0 : __pyx_t_9 = NULL;
22278 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
22279 0 : __PYX_ERR(0, 479, __pyx_L1_error)
22280 0 : __pyx_L14_unpacking_done:;
22281 : }
22282 111 : __pyx_v_i = __pyx_t_2;
22283 111 : __pyx_t_2 = 0;
22284 111 : __pyx_v_j = __pyx_t_1;
22285 111 : __pyx_t_1 = 0;
22286 :
22287 : /* "scipy/sparse/csgraph/_matching.pyx":481
22288 : * i, j = biadjacency_matrix.shape
22289 : *
22290 : * a = np.arange(np.min(biadjacency_matrix.shape)) # <<<<<<<<<<<<<<
22291 : *
22292 : * # The algorithm expects more columns than rows in the graph, so
22293 : */
22294 111 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error)
22295 111 : __Pyx_GOTREF(__pyx_t_1);
22296 111 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
22297 111 : __Pyx_GOTREF(__pyx_t_2);
22298 111 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22299 111 : __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 481, __pyx_L1_error)
22300 111 : __Pyx_GOTREF(__pyx_t_7);
22301 111 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_min); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 481, __pyx_L1_error)
22302 111 : __Pyx_GOTREF(__pyx_t_8);
22303 111 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22304 111 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 481, __pyx_L1_error)
22305 111 : __Pyx_GOTREF(__pyx_t_7);
22306 111 : __pyx_t_10 = NULL;
22307 111 : __pyx_t_4 = 0;
22308 : #if CYTHON_UNPACK_METHODS
22309 111 : if (unlikely(PyMethod_Check(__pyx_t_8))) {
22310 0 : __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
22311 0 : if (likely(__pyx_t_10)) {
22312 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
22313 0 : __Pyx_INCREF(__pyx_t_10);
22314 0 : __Pyx_INCREF(function);
22315 0 : __Pyx_DECREF_SET(__pyx_t_8, function);
22316 : __pyx_t_4 = 1;
22317 : }
22318 : }
22319 : #endif
22320 : {
22321 111 : PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_7};
22322 111 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
22323 111 : __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
22324 111 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22325 111 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error)
22326 111 : __Pyx_GOTREF(__pyx_t_1);
22327 111 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22328 : }
22329 111 : __pyx_t_8 = NULL;
22330 111 : __pyx_t_4 = 0;
22331 : #if CYTHON_UNPACK_METHODS
22332 111 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
22333 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
22334 0 : if (likely(__pyx_t_8)) {
22335 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
22336 0 : __Pyx_INCREF(__pyx_t_8);
22337 0 : __Pyx_INCREF(function);
22338 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
22339 : __pyx_t_4 = 1;
22340 : }
22341 : }
22342 : #endif
22343 : {
22344 111 : PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1};
22345 111 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
22346 111 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22347 111 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22348 111 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error)
22349 111 : __Pyx_GOTREF(__pyx_t_3);
22350 111 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22351 : }
22352 111 : __pyx_v_a = __pyx_t_3;
22353 111 : __pyx_t_3 = 0;
22354 :
22355 : /* "scipy/sparse/csgraph/_matching.pyx":489
22356 : * # checking for infeasibility during the execution of _lapjvsp below
22357 : * # instead, but some cases are not yet handled there.
22358 : * if j < i: # <<<<<<<<<<<<<<
22359 : * biadjacency_matrix_t = biadjacency_matrix.T
22360 : * if biadjacency_matrix_t.format != "csr":
22361 : */
22362 111 : __pyx_t_3 = PyObject_RichCompare(__pyx_v_j, __pyx_v_i, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error)
22363 111 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 489, __pyx_L1_error)
22364 111 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22365 111 : if (__pyx_t_5) {
22366 :
22367 : /* "scipy/sparse/csgraph/_matching.pyx":490
22368 : * # instead, but some cases are not yet handled there.
22369 : * if j < i:
22370 : * biadjacency_matrix_t = biadjacency_matrix.T # <<<<<<<<<<<<<<
22371 : * if biadjacency_matrix_t.format != "csr":
22372 : * biadjacency_matrix_t = biadjacency_matrix_t.tocsr()
22373 : */
22374 2 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L1_error)
22375 2 : __Pyx_GOTREF(__pyx_t_3);
22376 2 : __pyx_v_biadjacency_matrix_t = __pyx_t_3;
22377 2 : __pyx_t_3 = 0;
22378 :
22379 : /* "scipy/sparse/csgraph/_matching.pyx":491
22380 : * if j < i:
22381 : * biadjacency_matrix_t = biadjacency_matrix.T
22382 : * if biadjacency_matrix_t.format != "csr": # <<<<<<<<<<<<<<
22383 : * biadjacency_matrix_t = biadjacency_matrix_t.tocsr()
22384 : * matching, _ = _hopcroft_karp(biadjacency_matrix_t.indices,
22385 : */
22386 2 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix_t, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error)
22387 2 : __Pyx_GOTREF(__pyx_t_3);
22388 2 : __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_csr, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 491, __pyx_L1_error)
22389 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22390 2 : if (__pyx_t_5) {
22391 :
22392 : /* "scipy/sparse/csgraph/_matching.pyx":492
22393 : * biadjacency_matrix_t = biadjacency_matrix.T
22394 : * if biadjacency_matrix_t.format != "csr":
22395 : * biadjacency_matrix_t = biadjacency_matrix_t.tocsr() # <<<<<<<<<<<<<<
22396 : * matching, _ = _hopcroft_karp(biadjacency_matrix_t.indices,
22397 : * biadjacency_matrix_t.indptr,
22398 : */
22399 2 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix_t, __pyx_n_s_tocsr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error)
22400 2 : __Pyx_GOTREF(__pyx_t_2);
22401 2 : __pyx_t_1 = NULL;
22402 2 : __pyx_t_4 = 0;
22403 : #if CYTHON_UNPACK_METHODS
22404 2 : if (likely(PyMethod_Check(__pyx_t_2))) {
22405 2 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
22406 2 : if (likely(__pyx_t_1)) {
22407 2 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
22408 2 : __Pyx_INCREF(__pyx_t_1);
22409 2 : __Pyx_INCREF(function);
22410 2 : __Pyx_DECREF_SET(__pyx_t_2, function);
22411 : __pyx_t_4 = 1;
22412 : }
22413 : }
22414 : #endif
22415 : {
22416 2 : PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
22417 2 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
22418 2 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22419 2 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error)
22420 2 : __Pyx_GOTREF(__pyx_t_3);
22421 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22422 : }
22423 2 : __Pyx_DECREF_SET(__pyx_v_biadjacency_matrix_t, __pyx_t_3);
22424 2 : __pyx_t_3 = 0;
22425 :
22426 : /* "scipy/sparse/csgraph/_matching.pyx":491
22427 : * if j < i:
22428 : * biadjacency_matrix_t = biadjacency_matrix.T
22429 : * if biadjacency_matrix_t.format != "csr": # <<<<<<<<<<<<<<
22430 : * biadjacency_matrix_t = biadjacency_matrix_t.tocsr()
22431 : * matching, _ = _hopcroft_karp(biadjacency_matrix_t.indices,
22432 : */
22433 : }
22434 :
22435 : /* "scipy/sparse/csgraph/_matching.pyx":493
22436 : * if biadjacency_matrix_t.format != "csr":
22437 : * biadjacency_matrix_t = biadjacency_matrix_t.tocsr()
22438 : * matching, _ = _hopcroft_karp(biadjacency_matrix_t.indices, # <<<<<<<<<<<<<<
22439 : * biadjacency_matrix_t.indptr,
22440 : * j, i)
22441 : */
22442 2 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix_t, __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
22443 2 : __Pyx_GOTREF(__pyx_t_3);
22444 2 : __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t__const__(__pyx_t_3, 0); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 493, __pyx_L1_error)
22445 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22446 :
22447 : /* "scipy/sparse/csgraph/_matching.pyx":494
22448 : * biadjacency_matrix_t = biadjacency_matrix_t.tocsr()
22449 : * matching, _ = _hopcroft_karp(biadjacency_matrix_t.indices,
22450 : * biadjacency_matrix_t.indptr, # <<<<<<<<<<<<<<
22451 : * j, i)
22452 : * matching = np.asarray(matching)
22453 : */
22454 2 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix_t, __pyx_n_s_indptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error)
22455 2 : __Pyx_GOTREF(__pyx_t_3);
22456 2 : __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t__const__(__pyx_t_3, 0); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 494, __pyx_L1_error)
22457 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22458 :
22459 : /* "scipy/sparse/csgraph/_matching.pyx":495
22460 : * matching, _ = _hopcroft_karp(biadjacency_matrix_t.indices,
22461 : * biadjacency_matrix_t.indptr,
22462 : * j, i) # <<<<<<<<<<<<<<
22463 : * matching = np.asarray(matching)
22464 : * if np.sum(matching != -1) != min(i, j):
22465 : */
22466 2 : __pyx_t_13 = __Pyx_PyInt_As_npy_int32(__pyx_v_j); if (unlikely((__pyx_t_13 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L1_error)
22467 2 : __pyx_t_14 = __Pyx_PyInt_As_npy_int32(__pyx_v_i); if (unlikely((__pyx_t_14 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L1_error)
22468 :
22469 : /* "scipy/sparse/csgraph/_matching.pyx":493
22470 : * if biadjacency_matrix_t.format != "csr":
22471 : * biadjacency_matrix_t = biadjacency_matrix_t.tocsr()
22472 : * matching, _ = _hopcroft_karp(biadjacency_matrix_t.indices, # <<<<<<<<<<<<<<
22473 : * biadjacency_matrix_t.indptr,
22474 : * j, i)
22475 : */
22476 2 : __pyx_t_3 = __pyx_f_5scipy_6sparse_7csgraph_9_matching__hopcroft_karp(__pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
22477 2 : __Pyx_GOTREF(__pyx_t_3);
22478 2 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
22479 2 : __pyx_t_11.memview = NULL; __pyx_t_11.data = NULL;
22480 2 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1);
22481 2 : __pyx_t_12.memview = NULL; __pyx_t_12.data = NULL;
22482 2 : if (likely(__pyx_t_3 != Py_None)) {
22483 2 : PyObject* sequence = __pyx_t_3;
22484 2 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
22485 2 : if (unlikely(size != 2)) {
22486 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
22487 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
22488 0 : __PYX_ERR(0, 493, __pyx_L1_error)
22489 : }
22490 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22491 2 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
22492 2 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
22493 2 : __Pyx_INCREF(__pyx_t_2);
22494 2 : __Pyx_INCREF(__pyx_t_1);
22495 : #else
22496 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
22497 : __Pyx_GOTREF(__pyx_t_2);
22498 : __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
22499 : __Pyx_GOTREF(__pyx_t_1);
22500 : #endif
22501 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22502 : } else {
22503 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 493, __pyx_L1_error)
22504 : }
22505 2 : __pyx_v_matching = __pyx_t_2;
22506 2 : __pyx_t_2 = 0;
22507 2 : __pyx_v__ = __pyx_t_1;
22508 2 : __pyx_t_1 = 0;
22509 :
22510 : /* "scipy/sparse/csgraph/_matching.pyx":496
22511 : * biadjacency_matrix_t.indptr,
22512 : * j, i)
22513 : * matching = np.asarray(matching) # <<<<<<<<<<<<<<
22514 : * if np.sum(matching != -1) != min(i, j):
22515 : * raise ValueError('no full matching exists')
22516 : */
22517 2 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
22518 2 : __Pyx_GOTREF(__pyx_t_1);
22519 2 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
22520 2 : __Pyx_GOTREF(__pyx_t_2);
22521 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22522 2 : __pyx_t_1 = NULL;
22523 2 : __pyx_t_4 = 0;
22524 : #if CYTHON_UNPACK_METHODS
22525 2 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
22526 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
22527 0 : if (likely(__pyx_t_1)) {
22528 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
22529 0 : __Pyx_INCREF(__pyx_t_1);
22530 0 : __Pyx_INCREF(function);
22531 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
22532 : __pyx_t_4 = 1;
22533 : }
22534 : }
22535 : #endif
22536 : {
22537 2 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_matching};
22538 2 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
22539 2 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22540 2 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
22541 2 : __Pyx_GOTREF(__pyx_t_3);
22542 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22543 : }
22544 2 : __Pyx_DECREF_SET(__pyx_v_matching, __pyx_t_3);
22545 2 : __pyx_t_3 = 0;
22546 :
22547 : /* "scipy/sparse/csgraph/_matching.pyx":497
22548 : * j, i)
22549 : * matching = np.asarray(matching)
22550 : * if np.sum(matching != -1) != min(i, j): # <<<<<<<<<<<<<<
22551 : * raise ValueError('no full matching exists')
22552 : * b = np.asarray(_lapjvsp(biadjacency_matrix_t.indptr,
22553 : */
22554 2 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error)
22555 2 : __Pyx_GOTREF(__pyx_t_2);
22556 2 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error)
22557 2 : __Pyx_GOTREF(__pyx_t_1);
22558 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22559 2 : __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_v_matching, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error)
22560 2 : __Pyx_GOTREF(__pyx_t_2);
22561 2 : __pyx_t_8 = NULL;
22562 2 : __pyx_t_4 = 0;
22563 : #if CYTHON_UNPACK_METHODS
22564 2 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
22565 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
22566 0 : if (likely(__pyx_t_8)) {
22567 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
22568 0 : __Pyx_INCREF(__pyx_t_8);
22569 0 : __Pyx_INCREF(function);
22570 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
22571 : __pyx_t_4 = 1;
22572 : }
22573 : }
22574 : #endif
22575 : {
22576 2 : PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2};
22577 2 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
22578 2 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22579 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22580 2 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error)
22581 2 : __Pyx_GOTREF(__pyx_t_3);
22582 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22583 : }
22584 2 : __Pyx_INCREF(__pyx_v_j);
22585 2 : __pyx_t_1 = __pyx_v_j;
22586 2 : __Pyx_INCREF(__pyx_v_i);
22587 2 : __pyx_t_2 = __pyx_v_i;
22588 2 : __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 497, __pyx_L1_error)
22589 2 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 497, __pyx_L1_error)
22590 2 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22591 2 : if (__pyx_t_5) {
22592 2 : __Pyx_INCREF(__pyx_t_1);
22593 : __pyx_t_8 = __pyx_t_1;
22594 : } else {
22595 0 : __Pyx_INCREF(__pyx_t_2);
22596 : __pyx_t_8 = __pyx_t_2;
22597 : }
22598 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22599 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22600 2 : __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error)
22601 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22602 2 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22603 2 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 497, __pyx_L1_error)
22604 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22605 2 : if (unlikely(__pyx_t_5)) {
22606 :
22607 : /* "scipy/sparse/csgraph/_matching.pyx":498
22608 : * matching = np.asarray(matching)
22609 : * if np.sum(matching != -1) != min(i, j):
22610 : * raise ValueError('no full matching exists') # <<<<<<<<<<<<<<
22611 : * b = np.asarray(_lapjvsp(biadjacency_matrix_t.indptr,
22612 : * biadjacency_matrix_t.indices,
22613 : */
22614 1 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
22615 1 : __Pyx_GOTREF(__pyx_t_1);
22616 1 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
22617 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22618 1 : __PYX_ERR(0, 498, __pyx_L1_error)
22619 :
22620 : /* "scipy/sparse/csgraph/_matching.pyx":497
22621 : * j, i)
22622 : * matching = np.asarray(matching)
22623 : * if np.sum(matching != -1) != min(i, j): # <<<<<<<<<<<<<<
22624 : * raise ValueError('no full matching exists')
22625 : * b = np.asarray(_lapjvsp(biadjacency_matrix_t.indptr,
22626 : */
22627 : }
22628 :
22629 : /* "scipy/sparse/csgraph/_matching.pyx":499
22630 : * if np.sum(matching != -1) != min(i, j):
22631 : * raise ValueError('no full matching exists')
22632 : * b = np.asarray(_lapjvsp(biadjacency_matrix_t.indptr, # <<<<<<<<<<<<<<
22633 : * biadjacency_matrix_t.indices,
22634 : * biadjacency_matrix_t.data,
22635 : */
22636 1 : __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error)
22637 1 : __Pyx_GOTREF(__pyx_t_8);
22638 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error)
22639 1 : __Pyx_GOTREF(__pyx_t_3);
22640 1 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22641 1 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix_t, __pyx_n_s_indptr); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error)
22642 1 : __Pyx_GOTREF(__pyx_t_8);
22643 1 : __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 499, __pyx_L1_error)
22644 1 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22645 :
22646 : /* "scipy/sparse/csgraph/_matching.pyx":500
22647 : * raise ValueError('no full matching exists')
22648 : * b = np.asarray(_lapjvsp(biadjacency_matrix_t.indptr,
22649 : * biadjacency_matrix_t.indices, # <<<<<<<<<<<<<<
22650 : * biadjacency_matrix_t.data,
22651 : * j, i))
22652 : */
22653 1 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix_t, __pyx_n_s_indices); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 500, __pyx_L1_error)
22654 1 : __Pyx_GOTREF(__pyx_t_8);
22655 1 : __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 500, __pyx_L1_error)
22656 1 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22657 :
22658 : /* "scipy/sparse/csgraph/_matching.pyx":501
22659 : * b = np.asarray(_lapjvsp(biadjacency_matrix_t.indptr,
22660 : * biadjacency_matrix_t.indices,
22661 : * biadjacency_matrix_t.data, # <<<<<<<<<<<<<<
22662 : * j, i))
22663 : * indices = np.argsort(b)
22664 : */
22665 1 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix_t, __pyx_n_s_data); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 501, __pyx_L1_error)
22666 1 : __Pyx_GOTREF(__pyx_t_8);
22667 1 : __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 501, __pyx_L1_error)
22668 1 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22669 :
22670 : /* "scipy/sparse/csgraph/_matching.pyx":502
22671 : * biadjacency_matrix_t.indices,
22672 : * biadjacency_matrix_t.data,
22673 : * j, i)) # <<<<<<<<<<<<<<
22674 : * indices = np.argsort(b)
22675 : * return (b[indices], a[indices])
22676 : */
22677 1 : __pyx_t_14 = __Pyx_PyInt_As_npy_int32(__pyx_v_j); if (unlikely((__pyx_t_14 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 502, __pyx_L1_error)
22678 1 : __pyx_t_13 = __Pyx_PyInt_As_npy_int32(__pyx_v_i); if (unlikely((__pyx_t_13 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 502, __pyx_L1_error)
22679 :
22680 : /* "scipy/sparse/csgraph/_matching.pyx":499
22681 : * if np.sum(matching != -1) != min(i, j):
22682 : * raise ValueError('no full matching exists')
22683 : * b = np.asarray(_lapjvsp(biadjacency_matrix_t.indptr, # <<<<<<<<<<<<<<
22684 : * biadjacency_matrix_t.indices,
22685 : * biadjacency_matrix_t.data,
22686 : */
22687 1 : __pyx_t_18 = __pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp(__pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_14, __pyx_t_13); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 499, __pyx_L1_error)
22688 1 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
22689 1 : __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;
22690 1 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_16, 1);
22691 1 : __pyx_t_16.memview = NULL; __pyx_t_16.data = NULL;
22692 1 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
22693 1 : __pyx_t_17.memview = NULL; __pyx_t_17.data = NULL;
22694 1 : __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_t_18, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error)
22695 1 : __Pyx_GOTREF(__pyx_t_8);
22696 1 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_18, 1);
22697 1 : __pyx_t_18.memview = NULL; __pyx_t_18.data = NULL;
22698 1 : __pyx_t_2 = NULL;
22699 1 : __pyx_t_4 = 0;
22700 : #if CYTHON_UNPACK_METHODS
22701 1 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
22702 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
22703 0 : if (likely(__pyx_t_2)) {
22704 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
22705 0 : __Pyx_INCREF(__pyx_t_2);
22706 0 : __Pyx_INCREF(function);
22707 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
22708 : __pyx_t_4 = 1;
22709 : }
22710 : }
22711 : #endif
22712 : {
22713 1 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
22714 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
22715 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22716 1 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22717 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
22718 1 : __Pyx_GOTREF(__pyx_t_1);
22719 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22720 : }
22721 1 : __pyx_v_b = __pyx_t_1;
22722 1 : __pyx_t_1 = 0;
22723 :
22724 : /* "scipy/sparse/csgraph/_matching.pyx":503
22725 : * biadjacency_matrix_t.data,
22726 : * j, i))
22727 : * indices = np.argsort(b) # <<<<<<<<<<<<<<
22728 : * return (b[indices], a[indices])
22729 : * else:
22730 : */
22731 1 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
22732 1 : __Pyx_GOTREF(__pyx_t_3);
22733 1 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_argsort); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 503, __pyx_L1_error)
22734 1 : __Pyx_GOTREF(__pyx_t_8);
22735 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22736 1 : __pyx_t_3 = NULL;
22737 1 : __pyx_t_4 = 0;
22738 : #if CYTHON_UNPACK_METHODS
22739 1 : if (unlikely(PyMethod_Check(__pyx_t_8))) {
22740 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
22741 0 : if (likely(__pyx_t_3)) {
22742 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
22743 0 : __Pyx_INCREF(__pyx_t_3);
22744 0 : __Pyx_INCREF(function);
22745 0 : __Pyx_DECREF_SET(__pyx_t_8, function);
22746 : __pyx_t_4 = 1;
22747 : }
22748 : }
22749 : #endif
22750 : {
22751 1 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_b};
22752 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
22753 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22754 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
22755 1 : __Pyx_GOTREF(__pyx_t_1);
22756 1 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22757 : }
22758 1 : __pyx_v_indices = __pyx_t_1;
22759 1 : __pyx_t_1 = 0;
22760 :
22761 : /* "scipy/sparse/csgraph/_matching.pyx":504
22762 : * j, i))
22763 : * indices = np.argsort(b)
22764 : * return (b[indices], a[indices]) # <<<<<<<<<<<<<<
22765 : * else:
22766 : * if biadjacency_matrix.format != "csr":
22767 : */
22768 1 : __Pyx_XDECREF(__pyx_r);
22769 1 : __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_b, __pyx_v_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
22770 1 : __Pyx_GOTREF(__pyx_t_1);
22771 1 : __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_v_indices); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error)
22772 1 : __Pyx_GOTREF(__pyx_t_8);
22773 1 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error)
22774 1 : __Pyx_GOTREF(__pyx_t_3);
22775 1 : __Pyx_GIVEREF(__pyx_t_1);
22776 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error);
22777 1 : __Pyx_GIVEREF(__pyx_t_8);
22778 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error);
22779 1 : __pyx_t_1 = 0;
22780 1 : __pyx_t_8 = 0;
22781 1 : __pyx_r = __pyx_t_3;
22782 1 : __pyx_t_3 = 0;
22783 1 : goto __pyx_L0;
22784 :
22785 : /* "scipy/sparse/csgraph/_matching.pyx":489
22786 : * # checking for infeasibility during the execution of _lapjvsp below
22787 : * # instead, but some cases are not yet handled there.
22788 : * if j < i: # <<<<<<<<<<<<<<
22789 : * biadjacency_matrix_t = biadjacency_matrix.T
22790 : * if biadjacency_matrix_t.format != "csr":
22791 : */
22792 : }
22793 :
22794 : /* "scipy/sparse/csgraph/_matching.pyx":506
22795 : * return (b[indices], a[indices])
22796 : * else:
22797 : * if biadjacency_matrix.format != "csr": # <<<<<<<<<<<<<<
22798 : * biadjacency_matrix = biadjacency_matrix.tocsr()
22799 : * matching, _ = _hopcroft_karp(biadjacency_matrix.indices,
22800 : */
22801 : /*else*/ {
22802 109 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error)
22803 109 : __Pyx_GOTREF(__pyx_t_3);
22804 109 : __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_csr, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 506, __pyx_L1_error)
22805 109 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22806 109 : if (__pyx_t_5) {
22807 :
22808 : /* "scipy/sparse/csgraph/_matching.pyx":507
22809 : * else:
22810 : * if biadjacency_matrix.format != "csr":
22811 : * biadjacency_matrix = biadjacency_matrix.tocsr() # <<<<<<<<<<<<<<
22812 : * matching, _ = _hopcroft_karp(biadjacency_matrix.indices,
22813 : * biadjacency_matrix.indptr,
22814 : */
22815 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_tocsr); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 507, __pyx_L1_error)
22816 0 : __Pyx_GOTREF(__pyx_t_8);
22817 0 : __pyx_t_1 = NULL;
22818 0 : __pyx_t_4 = 0;
22819 : #if CYTHON_UNPACK_METHODS
22820 0 : if (likely(PyMethod_Check(__pyx_t_8))) {
22821 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
22822 0 : if (likely(__pyx_t_1)) {
22823 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
22824 0 : __Pyx_INCREF(__pyx_t_1);
22825 0 : __Pyx_INCREF(function);
22826 0 : __Pyx_DECREF_SET(__pyx_t_8, function);
22827 : __pyx_t_4 = 1;
22828 : }
22829 : }
22830 : #endif
22831 : {
22832 0 : PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
22833 0 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
22834 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22835 0 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
22836 0 : __Pyx_GOTREF(__pyx_t_3);
22837 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22838 : }
22839 0 : __Pyx_DECREF_SET(__pyx_v_biadjacency_matrix, __pyx_t_3);
22840 109 : __pyx_t_3 = 0;
22841 :
22842 : /* "scipy/sparse/csgraph/_matching.pyx":506
22843 : * return (b[indices], a[indices])
22844 : * else:
22845 : * if biadjacency_matrix.format != "csr": # <<<<<<<<<<<<<<
22846 : * biadjacency_matrix = biadjacency_matrix.tocsr()
22847 : * matching, _ = _hopcroft_karp(biadjacency_matrix.indices,
22848 : */
22849 : }
22850 :
22851 : /* "scipy/sparse/csgraph/_matching.pyx":508
22852 : * if biadjacency_matrix.format != "csr":
22853 : * biadjacency_matrix = biadjacency_matrix.tocsr()
22854 : * matching, _ = _hopcroft_karp(biadjacency_matrix.indices, # <<<<<<<<<<<<<<
22855 : * biadjacency_matrix.indptr,
22856 : * i, j)
22857 : */
22858 109 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
22859 109 : __Pyx_GOTREF(__pyx_t_3);
22860 109 : __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t__const__(__pyx_t_3, 0); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 508, __pyx_L1_error)
22861 109 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22862 :
22863 : /* "scipy/sparse/csgraph/_matching.pyx":509
22864 : * biadjacency_matrix = biadjacency_matrix.tocsr()
22865 : * matching, _ = _hopcroft_karp(biadjacency_matrix.indices,
22866 : * biadjacency_matrix.indptr, # <<<<<<<<<<<<<<
22867 : * i, j)
22868 : * matching = np.asarray(matching)
22869 : */
22870 109 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_indptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error)
22871 109 : __Pyx_GOTREF(__pyx_t_3);
22872 109 : __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t__const__(__pyx_t_3, 0); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 509, __pyx_L1_error)
22873 109 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22874 :
22875 : /* "scipy/sparse/csgraph/_matching.pyx":510
22876 : * matching, _ = _hopcroft_karp(biadjacency_matrix.indices,
22877 : * biadjacency_matrix.indptr,
22878 : * i, j) # <<<<<<<<<<<<<<
22879 : * matching = np.asarray(matching)
22880 : * if np.sum(matching != -1) != min(i, j):
22881 : */
22882 109 : __pyx_t_13 = __Pyx_PyInt_As_npy_int32(__pyx_v_i); if (unlikely((__pyx_t_13 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 510, __pyx_L1_error)
22883 109 : __pyx_t_14 = __Pyx_PyInt_As_npy_int32(__pyx_v_j); if (unlikely((__pyx_t_14 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 510, __pyx_L1_error)
22884 :
22885 : /* "scipy/sparse/csgraph/_matching.pyx":508
22886 : * if biadjacency_matrix.format != "csr":
22887 : * biadjacency_matrix = biadjacency_matrix.tocsr()
22888 : * matching, _ = _hopcroft_karp(biadjacency_matrix.indices, # <<<<<<<<<<<<<<
22889 : * biadjacency_matrix.indptr,
22890 : * i, j)
22891 : */
22892 109 : __pyx_t_3 = __pyx_f_5scipy_6sparse_7csgraph_9_matching__hopcroft_karp(__pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
22893 109 : __Pyx_GOTREF(__pyx_t_3);
22894 109 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
22895 109 : __pyx_t_11.memview = NULL; __pyx_t_11.data = NULL;
22896 109 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1);
22897 109 : __pyx_t_12.memview = NULL; __pyx_t_12.data = NULL;
22898 109 : if (likely(__pyx_t_3 != Py_None)) {
22899 109 : PyObject* sequence = __pyx_t_3;
22900 109 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
22901 109 : if (unlikely(size != 2)) {
22902 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
22903 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
22904 0 : __PYX_ERR(0, 508, __pyx_L1_error)
22905 : }
22906 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22907 109 : __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0);
22908 109 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
22909 109 : __Pyx_INCREF(__pyx_t_8);
22910 109 : __Pyx_INCREF(__pyx_t_1);
22911 : #else
22912 : __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 508, __pyx_L1_error)
22913 : __Pyx_GOTREF(__pyx_t_8);
22914 : __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
22915 : __Pyx_GOTREF(__pyx_t_1);
22916 : #endif
22917 109 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22918 : } else {
22919 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 508, __pyx_L1_error)
22920 : }
22921 109 : __pyx_v_matching = __pyx_t_8;
22922 109 : __pyx_t_8 = 0;
22923 109 : __pyx_v__ = __pyx_t_1;
22924 109 : __pyx_t_1 = 0;
22925 :
22926 : /* "scipy/sparse/csgraph/_matching.pyx":511
22927 : * biadjacency_matrix.indptr,
22928 : * i, j)
22929 : * matching = np.asarray(matching) # <<<<<<<<<<<<<<
22930 : * if np.sum(matching != -1) != min(i, j):
22931 : * raise ValueError('no full matching exists')
22932 : */
22933 109 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
22934 109 : __Pyx_GOTREF(__pyx_t_1);
22935 109 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 511, __pyx_L1_error)
22936 109 : __Pyx_GOTREF(__pyx_t_8);
22937 109 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22938 109 : __pyx_t_1 = NULL;
22939 109 : __pyx_t_4 = 0;
22940 : #if CYTHON_UNPACK_METHODS
22941 109 : if (unlikely(PyMethod_Check(__pyx_t_8))) {
22942 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
22943 0 : if (likely(__pyx_t_1)) {
22944 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
22945 0 : __Pyx_INCREF(__pyx_t_1);
22946 0 : __Pyx_INCREF(function);
22947 0 : __Pyx_DECREF_SET(__pyx_t_8, function);
22948 : __pyx_t_4 = 1;
22949 : }
22950 : }
22951 : #endif
22952 : {
22953 109 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_matching};
22954 109 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
22955 109 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22956 109 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error)
22957 109 : __Pyx_GOTREF(__pyx_t_3);
22958 109 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22959 : }
22960 109 : __Pyx_DECREF_SET(__pyx_v_matching, __pyx_t_3);
22961 109 : __pyx_t_3 = 0;
22962 :
22963 : /* "scipy/sparse/csgraph/_matching.pyx":512
22964 : * i, j)
22965 : * matching = np.asarray(matching)
22966 : * if np.sum(matching != -1) != min(i, j): # <<<<<<<<<<<<<<
22967 : * raise ValueError('no full matching exists')
22968 : * b = np.asarray(_lapjvsp(biadjacency_matrix.indptr,
22969 : */
22970 109 : __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 512, __pyx_L1_error)
22971 109 : __Pyx_GOTREF(__pyx_t_8);
22972 109 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
22973 109 : __Pyx_GOTREF(__pyx_t_1);
22974 109 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22975 109 : __pyx_t_8 = __Pyx_PyInt_NeObjC(__pyx_v_matching, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 512, __pyx_L1_error)
22976 109 : __Pyx_GOTREF(__pyx_t_8);
22977 109 : __pyx_t_2 = NULL;
22978 109 : __pyx_t_4 = 0;
22979 : #if CYTHON_UNPACK_METHODS
22980 109 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
22981 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
22982 0 : if (likely(__pyx_t_2)) {
22983 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
22984 0 : __Pyx_INCREF(__pyx_t_2);
22985 0 : __Pyx_INCREF(function);
22986 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
22987 : __pyx_t_4 = 1;
22988 : }
22989 : }
22990 : #endif
22991 : {
22992 109 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
22993 109 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
22994 109 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22995 109 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22996 109 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
22997 109 : __Pyx_GOTREF(__pyx_t_3);
22998 109 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22999 : }
23000 109 : __Pyx_INCREF(__pyx_v_j);
23001 109 : __pyx_t_1 = __pyx_v_j;
23002 109 : __Pyx_INCREF(__pyx_v_i);
23003 109 : __pyx_t_8 = __pyx_v_i;
23004 109 : __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 512, __pyx_L1_error)
23005 109 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 512, __pyx_L1_error)
23006 109 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23007 109 : if (__pyx_t_5) {
23008 0 : __Pyx_INCREF(__pyx_t_1);
23009 : __pyx_t_2 = __pyx_t_1;
23010 : } else {
23011 109 : __Pyx_INCREF(__pyx_t_8);
23012 : __pyx_t_2 = __pyx_t_8;
23013 : }
23014 109 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23015 109 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23016 109 : __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
23017 109 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23018 109 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23019 109 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 512, __pyx_L1_error)
23020 109 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23021 109 : if (unlikely(__pyx_t_5)) {
23022 :
23023 : /* "scipy/sparse/csgraph/_matching.pyx":513
23024 : * matching = np.asarray(matching)
23025 : * if np.sum(matching != -1) != min(i, j):
23026 : * raise ValueError('no full matching exists') # <<<<<<<<<<<<<<
23027 : * b = np.asarray(_lapjvsp(biadjacency_matrix.indptr,
23028 : * biadjacency_matrix.indices,
23029 : */
23030 42 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
23031 42 : __Pyx_GOTREF(__pyx_t_1);
23032 42 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
23033 42 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23034 42 : __PYX_ERR(0, 513, __pyx_L1_error)
23035 :
23036 : /* "scipy/sparse/csgraph/_matching.pyx":512
23037 : * i, j)
23038 : * matching = np.asarray(matching)
23039 : * if np.sum(matching != -1) != min(i, j): # <<<<<<<<<<<<<<
23040 : * raise ValueError('no full matching exists')
23041 : * b = np.asarray(_lapjvsp(biadjacency_matrix.indptr,
23042 : */
23043 : }
23044 :
23045 : /* "scipy/sparse/csgraph/_matching.pyx":514
23046 : * if np.sum(matching != -1) != min(i, j):
23047 : * raise ValueError('no full matching exists')
23048 : * b = np.asarray(_lapjvsp(biadjacency_matrix.indptr, # <<<<<<<<<<<<<<
23049 : * biadjacency_matrix.indices,
23050 : * biadjacency_matrix.data,
23051 : */
23052 67 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
23053 67 : __Pyx_GOTREF(__pyx_t_2);
23054 67 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error)
23055 67 : __Pyx_GOTREF(__pyx_t_3);
23056 67 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23057 67 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_indptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
23058 67 : __Pyx_GOTREF(__pyx_t_2);
23059 67 : __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 514, __pyx_L1_error)
23060 67 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23061 :
23062 : /* "scipy/sparse/csgraph/_matching.pyx":515
23063 : * raise ValueError('no full matching exists')
23064 : * b = np.asarray(_lapjvsp(biadjacency_matrix.indptr,
23065 : * biadjacency_matrix.indices, # <<<<<<<<<<<<<<
23066 : * biadjacency_matrix.data,
23067 : * i, j))
23068 : */
23069 67 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
23070 67 : __Pyx_GOTREF(__pyx_t_2);
23071 67 : __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 515, __pyx_L1_error)
23072 67 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23073 :
23074 : /* "scipy/sparse/csgraph/_matching.pyx":516
23075 : * b = np.asarray(_lapjvsp(biadjacency_matrix.indptr,
23076 : * biadjacency_matrix.indices,
23077 : * biadjacency_matrix.data, # <<<<<<<<<<<<<<
23078 : * i, j))
23079 : * return (a, b)
23080 : */
23081 67 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_biadjacency_matrix, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
23082 67 : __Pyx_GOTREF(__pyx_t_2);
23083 67 : __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 516, __pyx_L1_error)
23084 67 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23085 :
23086 : /* "scipy/sparse/csgraph/_matching.pyx":517
23087 : * biadjacency_matrix.indices,
23088 : * biadjacency_matrix.data,
23089 : * i, j)) # <<<<<<<<<<<<<<
23090 : * return (a, b)
23091 : *
23092 : */
23093 67 : __pyx_t_14 = __Pyx_PyInt_As_npy_int32(__pyx_v_i); if (unlikely((__pyx_t_14 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 517, __pyx_L1_error)
23094 67 : __pyx_t_13 = __Pyx_PyInt_As_npy_int32(__pyx_v_j); if (unlikely((__pyx_t_13 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 517, __pyx_L1_error)
23095 :
23096 : /* "scipy/sparse/csgraph/_matching.pyx":514
23097 : * if np.sum(matching != -1) != min(i, j):
23098 : * raise ValueError('no full matching exists')
23099 : * b = np.asarray(_lapjvsp(biadjacency_matrix.indptr, # <<<<<<<<<<<<<<
23100 : * biadjacency_matrix.indices,
23101 : * biadjacency_matrix.data,
23102 : */
23103 67 : __pyx_t_15 = __pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp(__pyx_t_18, __pyx_t_16, __pyx_t_17, __pyx_t_14, __pyx_t_13); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 514, __pyx_L1_error)
23104 67 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_18, 1);
23105 67 : __pyx_t_18.memview = NULL; __pyx_t_18.data = NULL;
23106 67 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_16, 1);
23107 67 : __pyx_t_16.memview = NULL; __pyx_t_16.data = NULL;
23108 67 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
23109 67 : __pyx_t_17.memview = NULL; __pyx_t_17.data = NULL;
23110 67 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_t_15, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
23111 67 : __Pyx_GOTREF(__pyx_t_2);
23112 67 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
23113 67 : __pyx_t_15.memview = NULL; __pyx_t_15.data = NULL;
23114 67 : __pyx_t_8 = NULL;
23115 67 : __pyx_t_4 = 0;
23116 : #if CYTHON_UNPACK_METHODS
23117 67 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
23118 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
23119 0 : if (likely(__pyx_t_8)) {
23120 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
23121 0 : __Pyx_INCREF(__pyx_t_8);
23122 0 : __Pyx_INCREF(function);
23123 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
23124 : __pyx_t_4 = 1;
23125 : }
23126 : }
23127 : #endif
23128 : {
23129 67 : PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2};
23130 67 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
23131 67 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
23132 67 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23133 67 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
23134 67 : __Pyx_GOTREF(__pyx_t_1);
23135 67 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23136 : }
23137 67 : __pyx_v_b = __pyx_t_1;
23138 67 : __pyx_t_1 = 0;
23139 :
23140 : /* "scipy/sparse/csgraph/_matching.pyx":518
23141 : * biadjacency_matrix.data,
23142 : * i, j))
23143 : * return (a, b) # <<<<<<<<<<<<<<
23144 : *
23145 : *
23146 : */
23147 67 : __Pyx_XDECREF(__pyx_r);
23148 67 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
23149 67 : __Pyx_GOTREF(__pyx_t_1);
23150 67 : __Pyx_INCREF(__pyx_v_a);
23151 67 : __Pyx_GIVEREF(__pyx_v_a);
23152 67 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_a)) __PYX_ERR(0, 518, __pyx_L1_error);
23153 67 : __Pyx_INCREF(__pyx_v_b);
23154 67 : __Pyx_GIVEREF(__pyx_v_b);
23155 67 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_b)) __PYX_ERR(0, 518, __pyx_L1_error);
23156 67 : __pyx_r = __pyx_t_1;
23157 67 : __pyx_t_1 = 0;
23158 67 : goto __pyx_L0;
23159 : }
23160 :
23161 : /* "scipy/sparse/csgraph/_matching.pyx":288
23162 : *
23163 : *
23164 : * def min_weight_full_bipartite_matching(biadjacency_matrix, maximize=False): # <<<<<<<<<<<<<<
23165 : * r"""
23166 : * min_weight_full_bipartite_matching(biadjacency_matrix, maximize=False)
23167 : */
23168 :
23169 : /* function exit code */
23170 43 : __pyx_L1_error:;
23171 43 : __Pyx_XDECREF(__pyx_t_1);
23172 43 : __Pyx_XDECREF(__pyx_t_2);
23173 43 : __Pyx_XDECREF(__pyx_t_3);
23174 43 : __Pyx_XDECREF(__pyx_t_7);
23175 43 : __Pyx_XDECREF(__pyx_t_8);
23176 43 : __Pyx_XDECREF(__pyx_t_10);
23177 43 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
23178 43 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1);
23179 43 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
23180 43 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_16, 1);
23181 43 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
23182 43 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_18, 1);
23183 43 : __Pyx_AddTraceback("scipy.sparse.csgraph._matching.min_weight_full_bipartite_matching", __pyx_clineno, __pyx_lineno, __pyx_filename);
23184 43 : __pyx_r = NULL;
23185 111 : __pyx_L0:;
23186 111 : __Pyx_XDECREF(__pyx_v_i);
23187 111 : __Pyx_XDECREF(__pyx_v_j);
23188 111 : __Pyx_XDECREF(__pyx_v_a);
23189 111 : __Pyx_XDECREF(__pyx_v_biadjacency_matrix_t);
23190 111 : __Pyx_XDECREF(__pyx_v_matching);
23191 111 : __Pyx_XDECREF(__pyx_v__);
23192 111 : __Pyx_XDECREF(__pyx_v_b);
23193 111 : __Pyx_XDECREF(__pyx_v_indices);
23194 111 : __Pyx_XDECREF(__pyx_v_biadjacency_matrix);
23195 111 : __Pyx_XGIVEREF(__pyx_r);
23196 111 : __Pyx_RefNannyFinishContext();
23197 111 : return __pyx_r;
23198 : }
23199 :
23200 : /* "scipy/sparse/csgraph/_matching.pyx":528
23201 : * @cython.boundscheck(False)
23202 : * @cython.wraparound(False)
23203 : * cdef ITYPE_t[:] _lapjvsp(ITYPE_t[:] first, # <<<<<<<<<<<<<<
23204 : * ITYPE_t[:] kk,
23205 : * DTYPE_t[:] cc,
23206 : */
23207 :
23208 68 : static __Pyx_memviewslice __pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp(__Pyx_memviewslice __pyx_v_first, __Pyx_memviewslice __pyx_v_kk, __Pyx_memviewslice __pyx_v_cc, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const __pyx_v_nr, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t const __pyx_v_nc) {
23209 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_l0;
23210 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_jp;
23211 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_t;
23212 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_i;
23213 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_lp;
23214 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_j1;
23215 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_tp;
23216 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_j0p;
23217 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_j1p;
23218 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_l0p;
23219 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_h;
23220 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_i0;
23221 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_td1;
23222 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t __pyx_v_min_diff;
23223 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t __pyx_v_v0;
23224 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t __pyx_v_vj;
23225 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t __pyx_v_dj;
23226 68 : __Pyx_memviewslice __pyx_v_v = { 0, 0, { 0 }, { 0 }, { 0 } };
23227 68 : __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
23228 68 : __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
23229 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_j;
23230 68 : __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
23231 68 : __Pyx_memviewslice __pyx_v_d = { 0, 0, { 0 }, { 0 }, { 0 } };
23232 68 : __Pyx_memviewslice __pyx_v_ok = { 0, 0, { 0 }, { 0 }, { 0 } };
23233 68 : __Pyx_memviewslice __pyx_v_xinv = { 0, 0, { 0 }, { 0 }, { 0 } };
23234 68 : __Pyx_memviewslice __pyx_v_free = { 0, 0, { 0 }, { 0 }, { 0 } };
23235 68 : __Pyx_memviewslice __pyx_v_todo = { 0, 0, { 0 }, { 0 }, { 0 } };
23236 68 : __Pyx_memviewslice __pyx_v_lab = { 0, 0, { 0 }, { 0 }, { 0 } };
23237 68 : CYTHON_UNUSED long __pyx_v__;
23238 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_l;
23239 68 : __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
23240 : __Pyx_RefNannyDeclarations
23241 68 : PyObject *__pyx_t_1 = NULL;
23242 68 : PyObject *__pyx_t_2 = NULL;
23243 68 : PyObject *__pyx_t_3 = NULL;
23244 68 : PyObject *__pyx_t_4 = NULL;
23245 68 : __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
23246 68 : __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
23247 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_7;
23248 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_8;
23249 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_9;
23250 68 : Py_ssize_t __pyx_t_10;
23251 68 : __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
23252 68 : int __pyx_t_12;
23253 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_13;
23254 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_14;
23255 68 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_15;
23256 68 : Py_ssize_t __pyx_t_16;
23257 68 : Py_ssize_t __pyx_t_17;
23258 68 : long __pyx_t_18;
23259 68 : int __pyx_lineno = 0;
23260 68 : const char *__pyx_filename = NULL;
23261 68 : int __pyx_clineno = 0;
23262 68 : __Pyx_RefNannySetupContext("_lapjvsp", 1);
23263 :
23264 : /* "scipy/sparse/csgraph/_matching.pyx":580
23265 : * cdef ITYPE_t l0, jp, t, i, lp, j1, tp, j0p, j1p, l0p, h, i0, td1
23266 : * cdef DTYPE_t min_diff, v0, vj, dj
23267 : * cdef DTYPE_t[:] v = np.zeros(nc, dtype=DTYPE) # <<<<<<<<<<<<<<
23268 : * cdef ITYPE_t[:] x = np.empty(nr, dtype=ITYPE)
23269 : * for i in range(nr):
23270 : */
23271 68 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error)
23272 68 : __Pyx_GOTREF(__pyx_t_1);
23273 68 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error)
23274 68 : __Pyx_GOTREF(__pyx_t_2);
23275 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23276 68 : __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error)
23277 68 : __Pyx_GOTREF(__pyx_t_1);
23278 68 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error)
23279 68 : __Pyx_GOTREF(__pyx_t_3);
23280 68 : __Pyx_GIVEREF(__pyx_t_1);
23281 68 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error);
23282 68 : __pyx_t_1 = 0;
23283 68 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error)
23284 68 : __Pyx_GOTREF(__pyx_t_1);
23285 68 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error)
23286 68 : __Pyx_GOTREF(__pyx_t_4);
23287 68 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 580, __pyx_L1_error)
23288 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23289 68 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error)
23290 68 : __Pyx_GOTREF(__pyx_t_4);
23291 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23292 68 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23293 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23294 68 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 580, __pyx_L1_error)
23295 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23296 68 : __pyx_v_v = __pyx_t_5;
23297 68 : __pyx_t_5.memview = NULL;
23298 68 : __pyx_t_5.data = NULL;
23299 :
23300 : /* "scipy/sparse/csgraph/_matching.pyx":581
23301 : * cdef DTYPE_t min_diff, v0, vj, dj
23302 : * cdef DTYPE_t[:] v = np.zeros(nc, dtype=DTYPE)
23303 : * cdef ITYPE_t[:] x = np.empty(nr, dtype=ITYPE) # <<<<<<<<<<<<<<
23304 : * for i in range(nr):
23305 : * x[i] = -1
23306 : */
23307 68 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error)
23308 68 : __Pyx_GOTREF(__pyx_t_4);
23309 68 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error)
23310 68 : __Pyx_GOTREF(__pyx_t_1);
23311 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23312 68 : __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_nr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error)
23313 68 : __Pyx_GOTREF(__pyx_t_4);
23314 68 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error)
23315 68 : __Pyx_GOTREF(__pyx_t_3);
23316 68 : __Pyx_GIVEREF(__pyx_t_4);
23317 68 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error);
23318 68 : __pyx_t_4 = 0;
23319 68 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error)
23320 68 : __Pyx_GOTREF(__pyx_t_4);
23321 68 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error)
23322 68 : __Pyx_GOTREF(__pyx_t_2);
23323 68 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 581, __pyx_L1_error)
23324 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23325 68 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error)
23326 68 : __Pyx_GOTREF(__pyx_t_2);
23327 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23328 68 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23329 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23330 68 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 581, __pyx_L1_error)
23331 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23332 68 : __pyx_v_x = __pyx_t_6;
23333 68 : __pyx_t_6.memview = NULL;
23334 68 : __pyx_t_6.data = NULL;
23335 :
23336 : /* "scipy/sparse/csgraph/_matching.pyx":582
23337 : * cdef DTYPE_t[:] v = np.zeros(nc, dtype=DTYPE)
23338 : * cdef ITYPE_t[:] x = np.empty(nr, dtype=ITYPE)
23339 : * for i in range(nr): # <<<<<<<<<<<<<<
23340 : * x[i] = -1
23341 : * cdef ITYPE_t[:] y = np.empty(nc, dtype=ITYPE)
23342 : */
23343 68 : __pyx_t_7 = __pyx_v_nr;
23344 68 : __pyx_t_8 = __pyx_t_7;
23345 6470 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
23346 6402 : __pyx_v_i = __pyx_t_9;
23347 :
23348 : /* "scipy/sparse/csgraph/_matching.pyx":583
23349 : * cdef ITYPE_t[:] x = np.empty(nr, dtype=ITYPE)
23350 : * for i in range(nr):
23351 : * x[i] = -1 # <<<<<<<<<<<<<<
23352 : * cdef ITYPE_t[:] y = np.empty(nc, dtype=ITYPE)
23353 : * for j in range(nc):
23354 : */
23355 6402 : __pyx_t_10 = __pyx_v_i;
23356 6402 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_10 * __pyx_v_x.strides[0]) )) = -1;
23357 : }
23358 :
23359 : /* "scipy/sparse/csgraph/_matching.pyx":584
23360 : * for i in range(nr):
23361 : * x[i] = -1
23362 : * cdef ITYPE_t[:] y = np.empty(nc, dtype=ITYPE) # <<<<<<<<<<<<<<
23363 : * for j in range(nc):
23364 : * y[j] = -1
23365 : */
23366 68 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error)
23367 68 : __Pyx_GOTREF(__pyx_t_2);
23368 68 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error)
23369 68 : __Pyx_GOTREF(__pyx_t_4);
23370 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23371 68 : __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_nc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error)
23372 68 : __Pyx_GOTREF(__pyx_t_2);
23373 68 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error)
23374 68 : __Pyx_GOTREF(__pyx_t_3);
23375 68 : __Pyx_GIVEREF(__pyx_t_2);
23376 68 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error);
23377 68 : __pyx_t_2 = 0;
23378 68 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error)
23379 68 : __Pyx_GOTREF(__pyx_t_2);
23380 68 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error)
23381 68 : __Pyx_GOTREF(__pyx_t_1);
23382 68 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 584, __pyx_L1_error)
23383 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23384 68 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error)
23385 68 : __Pyx_GOTREF(__pyx_t_1);
23386 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23387 68 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23388 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23389 68 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 584, __pyx_L1_error)
23390 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23391 68 : __pyx_v_y = __pyx_t_6;
23392 68 : __pyx_t_6.memview = NULL;
23393 68 : __pyx_t_6.data = NULL;
23394 :
23395 : /* "scipy/sparse/csgraph/_matching.pyx":585
23396 : * x[i] = -1
23397 : * cdef ITYPE_t[:] y = np.empty(nc, dtype=ITYPE)
23398 : * for j in range(nc): # <<<<<<<<<<<<<<
23399 : * y[j] = -1
23400 : * cdef DTYPE_t[:] u = np.zeros(nr, dtype=DTYPE)
23401 : */
23402 68 : __pyx_t_7 = __pyx_v_nc;
23403 68 : __pyx_t_8 = __pyx_t_7;
23404 6475 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
23405 6407 : __pyx_v_j = __pyx_t_9;
23406 :
23407 : /* "scipy/sparse/csgraph/_matching.pyx":586
23408 : * cdef ITYPE_t[:] y = np.empty(nc, dtype=ITYPE)
23409 : * for j in range(nc):
23410 : * y[j] = -1 # <<<<<<<<<<<<<<
23411 : * cdef DTYPE_t[:] u = np.zeros(nr, dtype=DTYPE)
23412 : * cdef DTYPE_t[:] d = np.zeros(nc, dtype=DTYPE)
23413 : */
23414 6407 : __pyx_t_10 = __pyx_v_j;
23415 6407 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_10 * __pyx_v_y.strides[0]) )) = -1;
23416 : }
23417 :
23418 : /* "scipy/sparse/csgraph/_matching.pyx":587
23419 : * for j in range(nc):
23420 : * y[j] = -1
23421 : * cdef DTYPE_t[:] u = np.zeros(nr, dtype=DTYPE) # <<<<<<<<<<<<<<
23422 : * cdef DTYPE_t[:] d = np.zeros(nc, dtype=DTYPE)
23423 : * cdef BTYPE_t[:] ok = np.zeros(nc, dtype=BTYPE)
23424 : */
23425 68 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
23426 68 : __Pyx_GOTREF(__pyx_t_1);
23427 68 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error)
23428 68 : __Pyx_GOTREF(__pyx_t_2);
23429 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23430 68 : __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
23431 68 : __Pyx_GOTREF(__pyx_t_1);
23432 68 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error)
23433 68 : __Pyx_GOTREF(__pyx_t_3);
23434 68 : __Pyx_GIVEREF(__pyx_t_1);
23435 68 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error);
23436 68 : __pyx_t_1 = 0;
23437 68 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
23438 68 : __Pyx_GOTREF(__pyx_t_1);
23439 68 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error)
23440 68 : __Pyx_GOTREF(__pyx_t_4);
23441 68 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 587, __pyx_L1_error)
23442 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23443 68 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error)
23444 68 : __Pyx_GOTREF(__pyx_t_4);
23445 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23446 68 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23447 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23448 68 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 587, __pyx_L1_error)
23449 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23450 68 : __pyx_v_u = __pyx_t_5;
23451 68 : __pyx_t_5.memview = NULL;
23452 68 : __pyx_t_5.data = NULL;
23453 :
23454 : /* "scipy/sparse/csgraph/_matching.pyx":588
23455 : * y[j] = -1
23456 : * cdef DTYPE_t[:] u = np.zeros(nr, dtype=DTYPE)
23457 : * cdef DTYPE_t[:] d = np.zeros(nc, dtype=DTYPE) # <<<<<<<<<<<<<<
23458 : * cdef BTYPE_t[:] ok = np.zeros(nc, dtype=BTYPE)
23459 : * cdef BTYPE_t[:] xinv = np.zeros(nr, dtype=BTYPE)
23460 : */
23461 68 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error)
23462 68 : __Pyx_GOTREF(__pyx_t_4);
23463 68 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
23464 68 : __Pyx_GOTREF(__pyx_t_1);
23465 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23466 68 : __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_nc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error)
23467 68 : __Pyx_GOTREF(__pyx_t_4);
23468 68 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error)
23469 68 : __Pyx_GOTREF(__pyx_t_3);
23470 68 : __Pyx_GIVEREF(__pyx_t_4);
23471 68 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error);
23472 68 : __pyx_t_4 = 0;
23473 68 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error)
23474 68 : __Pyx_GOTREF(__pyx_t_4);
23475 68 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
23476 68 : __Pyx_GOTREF(__pyx_t_2);
23477 68 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 588, __pyx_L1_error)
23478 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23479 68 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
23480 68 : __Pyx_GOTREF(__pyx_t_2);
23481 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23482 68 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23483 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23484 68 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 588, __pyx_L1_error)
23485 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23486 68 : __pyx_v_d = __pyx_t_5;
23487 68 : __pyx_t_5.memview = NULL;
23488 68 : __pyx_t_5.data = NULL;
23489 :
23490 : /* "scipy/sparse/csgraph/_matching.pyx":589
23491 : * cdef DTYPE_t[:] u = np.zeros(nr, dtype=DTYPE)
23492 : * cdef DTYPE_t[:] d = np.zeros(nc, dtype=DTYPE)
23493 : * cdef BTYPE_t[:] ok = np.zeros(nc, dtype=BTYPE) # <<<<<<<<<<<<<<
23494 : * cdef BTYPE_t[:] xinv = np.zeros(nr, dtype=BTYPE)
23495 : * cdef ITYPE_t[:] free = np.empty(nr, dtype=ITYPE)
23496 : */
23497 68 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error)
23498 68 : __Pyx_GOTREF(__pyx_t_2);
23499 68 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error)
23500 68 : __Pyx_GOTREF(__pyx_t_4);
23501 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23502 68 : __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_nc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error)
23503 68 : __Pyx_GOTREF(__pyx_t_2);
23504 68 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error)
23505 68 : __Pyx_GOTREF(__pyx_t_3);
23506 68 : __Pyx_GIVEREF(__pyx_t_2);
23507 68 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error);
23508 68 : __pyx_t_2 = 0;
23509 68 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error)
23510 68 : __Pyx_GOTREF(__pyx_t_2);
23511 68 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BTYPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error)
23512 68 : __Pyx_GOTREF(__pyx_t_1);
23513 68 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 589, __pyx_L1_error)
23514 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23515 68 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error)
23516 68 : __Pyx_GOTREF(__pyx_t_1);
23517 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23518 68 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23519 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23520 68 : __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 589, __pyx_L1_error)
23521 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23522 68 : __pyx_v_ok = __pyx_t_11;
23523 68 : __pyx_t_11.memview = NULL;
23524 68 : __pyx_t_11.data = NULL;
23525 :
23526 : /* "scipy/sparse/csgraph/_matching.pyx":590
23527 : * cdef DTYPE_t[:] d = np.zeros(nc, dtype=DTYPE)
23528 : * cdef BTYPE_t[:] ok = np.zeros(nc, dtype=BTYPE)
23529 : * cdef BTYPE_t[:] xinv = np.zeros(nr, dtype=BTYPE) # <<<<<<<<<<<<<<
23530 : * cdef ITYPE_t[:] free = np.empty(nr, dtype=ITYPE)
23531 : * for i in range(nr):
23532 : */
23533 68 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
23534 68 : __Pyx_GOTREF(__pyx_t_1);
23535 68 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
23536 68 : __Pyx_GOTREF(__pyx_t_2);
23537 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23538 68 : __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
23539 68 : __Pyx_GOTREF(__pyx_t_1);
23540 68 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
23541 68 : __Pyx_GOTREF(__pyx_t_3);
23542 68 : __Pyx_GIVEREF(__pyx_t_1);
23543 68 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error);
23544 68 : __pyx_t_1 = 0;
23545 68 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
23546 68 : __Pyx_GOTREF(__pyx_t_1);
23547 68 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BTYPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
23548 68 : __Pyx_GOTREF(__pyx_t_4);
23549 68 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 590, __pyx_L1_error)
23550 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23551 68 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
23552 68 : __Pyx_GOTREF(__pyx_t_4);
23553 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23554 68 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23555 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23556 68 : __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 590, __pyx_L1_error)
23557 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23558 68 : __pyx_v_xinv = __pyx_t_11;
23559 68 : __pyx_t_11.memview = NULL;
23560 68 : __pyx_t_11.data = NULL;
23561 :
23562 : /* "scipy/sparse/csgraph/_matching.pyx":591
23563 : * cdef BTYPE_t[:] ok = np.zeros(nc, dtype=BTYPE)
23564 : * cdef BTYPE_t[:] xinv = np.zeros(nr, dtype=BTYPE)
23565 : * cdef ITYPE_t[:] free = np.empty(nr, dtype=ITYPE) # <<<<<<<<<<<<<<
23566 : * for i in range(nr):
23567 : * free[i] = -1
23568 : */
23569 68 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error)
23570 68 : __Pyx_GOTREF(__pyx_t_4);
23571 68 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error)
23572 68 : __Pyx_GOTREF(__pyx_t_1);
23573 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23574 68 : __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_nr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error)
23575 68 : __Pyx_GOTREF(__pyx_t_4);
23576 68 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error)
23577 68 : __Pyx_GOTREF(__pyx_t_3);
23578 68 : __Pyx_GIVEREF(__pyx_t_4);
23579 68 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error);
23580 68 : __pyx_t_4 = 0;
23581 68 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error)
23582 68 : __Pyx_GOTREF(__pyx_t_4);
23583 68 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error)
23584 68 : __Pyx_GOTREF(__pyx_t_2);
23585 68 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 591, __pyx_L1_error)
23586 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23587 68 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error)
23588 68 : __Pyx_GOTREF(__pyx_t_2);
23589 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23590 68 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23591 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23592 68 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 591, __pyx_L1_error)
23593 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23594 68 : __pyx_v_free = __pyx_t_6;
23595 68 : __pyx_t_6.memview = NULL;
23596 68 : __pyx_t_6.data = NULL;
23597 :
23598 : /* "scipy/sparse/csgraph/_matching.pyx":592
23599 : * cdef BTYPE_t[:] xinv = np.zeros(nr, dtype=BTYPE)
23600 : * cdef ITYPE_t[:] free = np.empty(nr, dtype=ITYPE)
23601 : * for i in range(nr): # <<<<<<<<<<<<<<
23602 : * free[i] = -1
23603 : * cdef ITYPE_t[:] todo = np.empty(nc, dtype=ITYPE)
23604 : */
23605 68 : __pyx_t_7 = __pyx_v_nr;
23606 68 : __pyx_t_8 = __pyx_t_7;
23607 6470 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
23608 6402 : __pyx_v_i = __pyx_t_9;
23609 :
23610 : /* "scipy/sparse/csgraph/_matching.pyx":593
23611 : * cdef ITYPE_t[:] free = np.empty(nr, dtype=ITYPE)
23612 : * for i in range(nr):
23613 : * free[i] = -1 # <<<<<<<<<<<<<<
23614 : * cdef ITYPE_t[:] todo = np.empty(nc, dtype=ITYPE)
23615 : * for j in range(nc):
23616 : */
23617 6402 : __pyx_t_10 = __pyx_v_i;
23618 6402 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_free.data + __pyx_t_10 * __pyx_v_free.strides[0]) )) = -1;
23619 : }
23620 :
23621 : /* "scipy/sparse/csgraph/_matching.pyx":594
23622 : * for i in range(nr):
23623 : * free[i] = -1
23624 : * cdef ITYPE_t[:] todo = np.empty(nc, dtype=ITYPE) # <<<<<<<<<<<<<<
23625 : * for j in range(nc):
23626 : * todo[j] = -1
23627 : */
23628 68 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error)
23629 68 : __Pyx_GOTREF(__pyx_t_2);
23630 68 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L1_error)
23631 68 : __Pyx_GOTREF(__pyx_t_4);
23632 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23633 68 : __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_nc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error)
23634 68 : __Pyx_GOTREF(__pyx_t_2);
23635 68 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error)
23636 68 : __Pyx_GOTREF(__pyx_t_3);
23637 68 : __Pyx_GIVEREF(__pyx_t_2);
23638 68 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error);
23639 68 : __pyx_t_2 = 0;
23640 68 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error)
23641 68 : __Pyx_GOTREF(__pyx_t_2);
23642 68 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error)
23643 68 : __Pyx_GOTREF(__pyx_t_1);
23644 68 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 594, __pyx_L1_error)
23645 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23646 68 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error)
23647 68 : __Pyx_GOTREF(__pyx_t_1);
23648 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23649 68 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23650 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23651 68 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 594, __pyx_L1_error)
23652 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23653 68 : __pyx_v_todo = __pyx_t_6;
23654 68 : __pyx_t_6.memview = NULL;
23655 68 : __pyx_t_6.data = NULL;
23656 :
23657 : /* "scipy/sparse/csgraph/_matching.pyx":595
23658 : * free[i] = -1
23659 : * cdef ITYPE_t[:] todo = np.empty(nc, dtype=ITYPE)
23660 : * for j in range(nc): # <<<<<<<<<<<<<<
23661 : * todo[j] = -1
23662 : * cdef ITYPE_t[:] lab = np.zeros(nc, dtype=ITYPE)
23663 : */
23664 68 : __pyx_t_7 = __pyx_v_nc;
23665 68 : __pyx_t_8 = __pyx_t_7;
23666 6475 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
23667 6407 : __pyx_v_j = __pyx_t_9;
23668 :
23669 : /* "scipy/sparse/csgraph/_matching.pyx":596
23670 : * cdef ITYPE_t[:] todo = np.empty(nc, dtype=ITYPE)
23671 : * for j in range(nc):
23672 : * todo[j] = -1 # <<<<<<<<<<<<<<
23673 : * cdef ITYPE_t[:] lab = np.zeros(nc, dtype=ITYPE)
23674 : *
23675 : */
23676 6407 : __pyx_t_10 = __pyx_v_j;
23677 6407 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_todo.data + __pyx_t_10 * __pyx_v_todo.strides[0]) )) = -1;
23678 : }
23679 :
23680 : /* "scipy/sparse/csgraph/_matching.pyx":597
23681 : * for j in range(nc):
23682 : * todo[j] = -1
23683 : * cdef ITYPE_t[:] lab = np.zeros(nc, dtype=ITYPE) # <<<<<<<<<<<<<<
23684 : *
23685 : * # We skip the initialization entirely in the non-square case and instead
23686 : */
23687 68 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error)
23688 68 : __Pyx_GOTREF(__pyx_t_1);
23689 68 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error)
23690 68 : __Pyx_GOTREF(__pyx_t_2);
23691 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23692 68 : __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error)
23693 68 : __Pyx_GOTREF(__pyx_t_1);
23694 68 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error)
23695 68 : __Pyx_GOTREF(__pyx_t_3);
23696 68 : __Pyx_GIVEREF(__pyx_t_1);
23697 68 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error);
23698 68 : __pyx_t_1 = 0;
23699 68 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error)
23700 68 : __Pyx_GOTREF(__pyx_t_1);
23701 68 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 597, __pyx_L1_error)
23702 68 : __Pyx_GOTREF(__pyx_t_4);
23703 68 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 597, __pyx_L1_error)
23704 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23705 68 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 597, __pyx_L1_error)
23706 68 : __Pyx_GOTREF(__pyx_t_4);
23707 68 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23708 68 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23709 68 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23710 68 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 597, __pyx_L1_error)
23711 68 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23712 68 : __pyx_v_lab = __pyx_t_6;
23713 68 : __pyx_t_6.memview = NULL;
23714 68 : __pyx_t_6.data = NULL;
23715 :
23716 : /* "scipy/sparse/csgraph/_matching.pyx":601
23717 : * # We skip the initialization entirely in the non-square case and instead
23718 : * # fill all of `free` explicitly.
23719 : * if nr == nc: # <<<<<<<<<<<<<<
23720 : * # From here, proceed from line 55 in the original Pascal code, LAPJVS.P
23721 : * for jp in range(nc):
23722 : */
23723 68 : __pyx_t_12 = (__pyx_v_nr == __pyx_v_nc);
23724 68 : if (__pyx_t_12) {
23725 :
23726 : /* "scipy/sparse/csgraph/_matching.pyx":603
23727 : * if nr == nc:
23728 : * # From here, proceed from line 55 in the original Pascal code, LAPJVS.P
23729 : * for jp in range(nc): # <<<<<<<<<<<<<<
23730 : * v[jp] = INFINITY
23731 : * for i in range(nr):
23732 : */
23733 6468 : __pyx_t_7 = __pyx_v_nc;
23734 6468 : __pyx_t_8 = __pyx_t_7;
23735 6468 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
23736 6402 : __pyx_v_jp = __pyx_t_9;
23737 :
23738 : /* "scipy/sparse/csgraph/_matching.pyx":604
23739 : * # From here, proceed from line 55 in the original Pascal code, LAPJVS.P
23740 : * for jp in range(nc):
23741 : * v[jp] = INFINITY # <<<<<<<<<<<<<<
23742 : * for i in range(nr):
23743 : * for t in range(first[i], first[i + 1]):
23744 : */
23745 6402 : __pyx_t_10 = __pyx_v_jp;
23746 6402 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_10 * __pyx_v_v.strides[0]) )) = INFINITY;
23747 : }
23748 :
23749 : /* "scipy/sparse/csgraph/_matching.pyx":605
23750 : * for jp in range(nc):
23751 : * v[jp] = INFINITY
23752 : * for i in range(nr): # <<<<<<<<<<<<<<
23753 : * for t in range(first[i], first[i + 1]):
23754 : * jp = kk[t]
23755 : */
23756 6468 : __pyx_t_7 = __pyx_v_nr;
23757 6468 : __pyx_t_8 = __pyx_t_7;
23758 6468 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
23759 6402 : __pyx_v_i = __pyx_t_9;
23760 :
23761 : /* "scipy/sparse/csgraph/_matching.pyx":606
23762 : * v[jp] = INFINITY
23763 : * for i in range(nr):
23764 : * for t in range(first[i], first[i + 1]): # <<<<<<<<<<<<<<
23765 : * jp = kk[t]
23766 : * if cc[t] < v[jp]:
23767 : */
23768 6402 : __pyx_t_10 = (__pyx_v_i + 1);
23769 6402 : __pyx_t_13 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_first.data + __pyx_t_10 * __pyx_v_first.strides[0]) )));
23770 6402 : __pyx_t_10 = __pyx_v_i;
23771 6402 : __pyx_t_14 = __pyx_t_13;
23772 44804 : for (__pyx_t_15 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_first.data + __pyx_t_10 * __pyx_v_first.strides[0]) ))); __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
23773 38402 : __pyx_v_t = __pyx_t_15;
23774 :
23775 : /* "scipy/sparse/csgraph/_matching.pyx":607
23776 : * for i in range(nr):
23777 : * for t in range(first[i], first[i + 1]):
23778 : * jp = kk[t] # <<<<<<<<<<<<<<
23779 : * if cc[t] < v[jp]:
23780 : * v[jp] = cc[t]
23781 : */
23782 38402 : __pyx_t_16 = __pyx_v_t;
23783 38402 : __pyx_v_jp = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_kk.data + __pyx_t_16 * __pyx_v_kk.strides[0]) )));
23784 :
23785 : /* "scipy/sparse/csgraph/_matching.pyx":608
23786 : * for t in range(first[i], first[i + 1]):
23787 : * jp = kk[t]
23788 : * if cc[t] < v[jp]: # <<<<<<<<<<<<<<
23789 : * v[jp] = cc[t]
23790 : * y[jp] = i
23791 : */
23792 38402 : __pyx_t_16 = __pyx_v_t;
23793 38402 : __pyx_t_17 = __pyx_v_jp;
23794 38402 : __pyx_t_12 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_cc.data + __pyx_t_16 * __pyx_v_cc.strides[0]) ))) < (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))));
23795 38402 : if (__pyx_t_12) {
23796 :
23797 : /* "scipy/sparse/csgraph/_matching.pyx":609
23798 : * jp = kk[t]
23799 : * if cc[t] < v[jp]:
23800 : * v[jp] = cc[t] # <<<<<<<<<<<<<<
23801 : * y[jp] = i
23802 : * for jp in range(nc - 1, -1, -1):
23803 : */
23804 15067 : __pyx_t_17 = __pyx_v_t;
23805 15067 : __pyx_t_16 = __pyx_v_jp;
23806 15067 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) )) = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_cc.data + __pyx_t_17 * __pyx_v_cc.strides[0]) )));
23807 :
23808 : /* "scipy/sparse/csgraph/_matching.pyx":610
23809 : * if cc[t] < v[jp]:
23810 : * v[jp] = cc[t]
23811 : * y[jp] = i # <<<<<<<<<<<<<<
23812 : * for jp in range(nc - 1, -1, -1):
23813 : * i = y[jp]
23814 : */
23815 15067 : __pyx_t_17 = __pyx_v_jp;
23816 15067 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_17 * __pyx_v_y.strides[0]) )) = __pyx_v_i;
23817 :
23818 : /* "scipy/sparse/csgraph/_matching.pyx":608
23819 : * for t in range(first[i], first[i + 1]):
23820 : * jp = kk[t]
23821 : * if cc[t] < v[jp]: # <<<<<<<<<<<<<<
23822 : * v[jp] = cc[t]
23823 : * y[jp] = i
23824 : */
23825 : }
23826 : }
23827 : }
23828 :
23829 : /* "scipy/sparse/csgraph/_matching.pyx":611
23830 : * v[jp] = cc[t]
23831 : * y[jp] = i
23832 : * for jp in range(nc - 1, -1, -1): # <<<<<<<<<<<<<<
23833 : * i = y[jp]
23834 : * # If no row has been matched with column jp at this point, that
23835 : */
23836 6468 : for (__pyx_t_7 = (__pyx_v_nc - 1); __pyx_t_7 > -1; __pyx_t_7-=1) {
23837 6402 : __pyx_v_jp = __pyx_t_7;
23838 :
23839 : /* "scipy/sparse/csgraph/_matching.pyx":612
23840 : * y[jp] = i
23841 : * for jp in range(nc - 1, -1, -1):
23842 : * i = y[jp] # <<<<<<<<<<<<<<
23843 : * # If no row has been matched with column jp at this point, that
23844 : * # can only mean that the column has no incident rows at all.
23845 : */
23846 6402 : __pyx_t_10 = __pyx_v_jp;
23847 6402 : __pyx_v_i = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_10 * __pyx_v_y.strides[0]) )));
23848 :
23849 : /* "scipy/sparse/csgraph/_matching.pyx":615
23850 : * # If no row has been matched with column jp at this point, that
23851 : * # can only mean that the column has no incident rows at all.
23852 : * if i == -1: # <<<<<<<<<<<<<<
23853 : * raise ValueError('no full matching exists')
23854 : * if x[i] == -1:
23855 : */
23856 6402 : __pyx_t_12 = (__pyx_v_i == -1L);
23857 6402 : if (unlikely(__pyx_t_12)) {
23858 :
23859 : /* "scipy/sparse/csgraph/_matching.pyx":616
23860 : * # can only mean that the column has no incident rows at all.
23861 : * if i == -1:
23862 : * raise ValueError('no full matching exists') # <<<<<<<<<<<<<<
23863 : * if x[i] == -1:
23864 : * x[i] = jp
23865 : */
23866 0 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error)
23867 0 : __Pyx_GOTREF(__pyx_t_4);
23868 0 : __Pyx_Raise(__pyx_t_4, 0, 0, 0);
23869 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23870 0 : __PYX_ERR(0, 616, __pyx_L1_error)
23871 :
23872 : /* "scipy/sparse/csgraph/_matching.pyx":615
23873 : * # If no row has been matched with column jp at this point, that
23874 : * # can only mean that the column has no incident rows at all.
23875 : * if i == -1: # <<<<<<<<<<<<<<
23876 : * raise ValueError('no full matching exists')
23877 : * if x[i] == -1:
23878 : */
23879 : }
23880 :
23881 : /* "scipy/sparse/csgraph/_matching.pyx":617
23882 : * if i == -1:
23883 : * raise ValueError('no full matching exists')
23884 : * if x[i] == -1: # <<<<<<<<<<<<<<
23885 : * x[i] = jp
23886 : * else:
23887 : */
23888 6402 : __pyx_t_10 = __pyx_v_i;
23889 6402 : __pyx_t_12 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_10 * __pyx_v_x.strides[0]) ))) == -1L);
23890 6402 : if (__pyx_t_12) {
23891 :
23892 : /* "scipy/sparse/csgraph/_matching.pyx":618
23893 : * raise ValueError('no full matching exists')
23894 : * if x[i] == -1:
23895 : * x[i] = jp # <<<<<<<<<<<<<<
23896 : * else:
23897 : * y[jp] = -1
23898 : */
23899 4053 : __pyx_t_10 = __pyx_v_i;
23900 4053 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_10 * __pyx_v_x.strides[0]) )) = __pyx_v_jp;
23901 :
23902 : /* "scipy/sparse/csgraph/_matching.pyx":617
23903 : * if i == -1:
23904 : * raise ValueError('no full matching exists')
23905 : * if x[i] == -1: # <<<<<<<<<<<<<<
23906 : * x[i] = jp
23907 : * else:
23908 : */
23909 4053 : goto __pyx_L22;
23910 : }
23911 :
23912 : /* "scipy/sparse/csgraph/_matching.pyx":620
23913 : * x[i] = jp
23914 : * else:
23915 : * y[jp] = -1 # <<<<<<<<<<<<<<
23916 : * # Here, the original Pascal code simply inverts the sign of
23917 : * # x[i]; as that doesn't play too well with zero-indexing, we
23918 : */
23919 : /*else*/ {
23920 2349 : __pyx_t_10 = __pyx_v_jp;
23921 2349 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_10 * __pyx_v_y.strides[0]) )) = -1;
23922 :
23923 : /* "scipy/sparse/csgraph/_matching.pyx":624
23924 : * # x[i]; as that doesn't play too well with zero-indexing, we
23925 : * # explicitly keep track of uniqueness instead.
23926 : * xinv[i] = 1 # <<<<<<<<<<<<<<
23927 : * lp = 0
23928 : * for i in range(nr):
23929 : */
23930 2349 : __pyx_t_10 = __pyx_v_i;
23931 2349 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t *) ( /* dim=0 */ (__pyx_v_xinv.data + __pyx_t_10 * __pyx_v_xinv.strides[0]) )) = 1;
23932 : }
23933 6402 : __pyx_L22:;
23934 : }
23935 :
23936 : /* "scipy/sparse/csgraph/_matching.pyx":625
23937 : * # explicitly keep track of uniqueness instead.
23938 : * xinv[i] = 1
23939 : * lp = 0 # <<<<<<<<<<<<<<
23940 : * for i in range(nr):
23941 : * if xinv[i] == 1:
23942 : */
23943 : __pyx_v_lp = 0;
23944 :
23945 : /* "scipy/sparse/csgraph/_matching.pyx":626
23946 : * xinv[i] = 1
23947 : * lp = 0
23948 : * for i in range(nr): # <<<<<<<<<<<<<<
23949 : * if xinv[i] == 1:
23950 : * continue
23951 : */
23952 6468 : __pyx_t_7 = __pyx_v_nr;
23953 6468 : __pyx_t_8 = __pyx_t_7;
23954 6468 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
23955 6402 : __pyx_v_i = __pyx_t_9;
23956 :
23957 : /* "scipy/sparse/csgraph/_matching.pyx":627
23958 : * lp = 0
23959 : * for i in range(nr):
23960 : * if xinv[i] == 1: # <<<<<<<<<<<<<<
23961 : * continue
23962 : * if x[i] != -1:
23963 : */
23964 6402 : __pyx_t_10 = __pyx_v_i;
23965 6402 : __pyx_t_12 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t *) ( /* dim=0 */ (__pyx_v_xinv.data + __pyx_t_10 * __pyx_v_xinv.strides[0]) ))) == 1);
23966 6402 : if (__pyx_t_12) {
23967 :
23968 : /* "scipy/sparse/csgraph/_matching.pyx":628
23969 : * for i in range(nr):
23970 : * if xinv[i] == 1:
23971 : * continue # <<<<<<<<<<<<<<
23972 : * if x[i] != -1:
23973 : * min_diff = INFINITY
23974 : */
23975 1680 : goto __pyx_L23_continue;
23976 :
23977 : /* "scipy/sparse/csgraph/_matching.pyx":627
23978 : * lp = 0
23979 : * for i in range(nr):
23980 : * if xinv[i] == 1: # <<<<<<<<<<<<<<
23981 : * continue
23982 : * if x[i] != -1:
23983 : */
23984 : }
23985 :
23986 : /* "scipy/sparse/csgraph/_matching.pyx":629
23987 : * if xinv[i] == 1:
23988 : * continue
23989 : * if x[i] != -1: # <<<<<<<<<<<<<<
23990 : * min_diff = INFINITY
23991 : * j1 = x[i]
23992 : */
23993 4722 : __pyx_t_10 = __pyx_v_i;
23994 4722 : __pyx_t_12 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_10 * __pyx_v_x.strides[0]) ))) != -1L);
23995 4722 : if (__pyx_t_12) {
23996 :
23997 : /* "scipy/sparse/csgraph/_matching.pyx":630
23998 : * continue
23999 : * if x[i] != -1:
24000 : * min_diff = INFINITY # <<<<<<<<<<<<<<
24001 : * j1 = x[i]
24002 : * for t in range(first[i], first[i + 1]):
24003 : */
24004 2373 : __pyx_v_min_diff = INFINITY;
24005 :
24006 : /* "scipy/sparse/csgraph/_matching.pyx":631
24007 : * if x[i] != -1:
24008 : * min_diff = INFINITY
24009 : * j1 = x[i] # <<<<<<<<<<<<<<
24010 : * for t in range(first[i], first[i + 1]):
24011 : * jp = kk[t]
24012 : */
24013 2373 : __pyx_t_10 = __pyx_v_i;
24014 2373 : __pyx_v_j1 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_10 * __pyx_v_x.strides[0]) )));
24015 :
24016 : /* "scipy/sparse/csgraph/_matching.pyx":632
24017 : * min_diff = INFINITY
24018 : * j1 = x[i]
24019 : * for t in range(first[i], first[i + 1]): # <<<<<<<<<<<<<<
24020 : * jp = kk[t]
24021 : * if jp != j1:
24022 : */
24023 2373 : __pyx_t_10 = (__pyx_v_i + 1);
24024 2373 : __pyx_t_13 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_first.data + __pyx_t_10 * __pyx_v_first.strides[0]) )));
24025 2373 : __pyx_t_10 = __pyx_v_i;
24026 2373 : __pyx_t_14 = __pyx_t_13;
24027 16694 : for (__pyx_t_15 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_first.data + __pyx_t_10 * __pyx_v_first.strides[0]) ))); __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
24028 14321 : __pyx_v_t = __pyx_t_15;
24029 :
24030 : /* "scipy/sparse/csgraph/_matching.pyx":633
24031 : * j1 = x[i]
24032 : * for t in range(first[i], first[i + 1]):
24033 : * jp = kk[t] # <<<<<<<<<<<<<<
24034 : * if jp != j1:
24035 : * if cc[t] - v[jp] < min_diff:
24036 : */
24037 14321 : __pyx_t_17 = __pyx_v_t;
24038 14321 : __pyx_v_jp = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_kk.data + __pyx_t_17 * __pyx_v_kk.strides[0]) )));
24039 :
24040 : /* "scipy/sparse/csgraph/_matching.pyx":634
24041 : * for t in range(first[i], first[i + 1]):
24042 : * jp = kk[t]
24043 : * if jp != j1: # <<<<<<<<<<<<<<
24044 : * if cc[t] - v[jp] < min_diff:
24045 : * min_diff = cc[t] - v[jp]
24046 : */
24047 14321 : __pyx_t_12 = (__pyx_v_jp != __pyx_v_j1);
24048 14321 : if (__pyx_t_12) {
24049 :
24050 : /* "scipy/sparse/csgraph/_matching.pyx":635
24051 : * jp = kk[t]
24052 : * if jp != j1:
24053 : * if cc[t] - v[jp] < min_diff: # <<<<<<<<<<<<<<
24054 : * min_diff = cc[t] - v[jp]
24055 : * u[i] = min_diff
24056 : */
24057 11948 : __pyx_t_17 = __pyx_v_t;
24058 11948 : __pyx_t_16 = __pyx_v_jp;
24059 11948 : __pyx_t_12 = (((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_cc.data + __pyx_t_17 * __pyx_v_cc.strides[0]) ))) - (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) )))) < __pyx_v_min_diff);
24060 11948 : if (__pyx_t_12) {
24061 :
24062 : /* "scipy/sparse/csgraph/_matching.pyx":636
24063 : * if jp != j1:
24064 : * if cc[t] - v[jp] < min_diff:
24065 : * min_diff = cc[t] - v[jp] # <<<<<<<<<<<<<<
24066 : * u[i] = min_diff
24067 : * tp = first[i]
24068 : */
24069 14321 : __pyx_t_16 = __pyx_v_t;
24070 14321 : __pyx_t_17 = __pyx_v_jp;
24071 14321 : __pyx_v_min_diff = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_cc.data + __pyx_t_16 * __pyx_v_cc.strides[0]) ))) - (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))));
24072 :
24073 : /* "scipy/sparse/csgraph/_matching.pyx":635
24074 : * jp = kk[t]
24075 : * if jp != j1:
24076 : * if cc[t] - v[jp] < min_diff: # <<<<<<<<<<<<<<
24077 : * min_diff = cc[t] - v[jp]
24078 : * u[i] = min_diff
24079 : */
24080 : }
24081 :
24082 : /* "scipy/sparse/csgraph/_matching.pyx":634
24083 : * for t in range(first[i], first[i + 1]):
24084 : * jp = kk[t]
24085 : * if jp != j1: # <<<<<<<<<<<<<<
24086 : * if cc[t] - v[jp] < min_diff:
24087 : * min_diff = cc[t] - v[jp]
24088 : */
24089 : }
24090 : }
24091 :
24092 : /* "scipy/sparse/csgraph/_matching.pyx":637
24093 : * if cc[t] - v[jp] < min_diff:
24094 : * min_diff = cc[t] - v[jp]
24095 : * u[i] = min_diff # <<<<<<<<<<<<<<
24096 : * tp = first[i]
24097 : * while kk[tp] != j1:
24098 : */
24099 2373 : __pyx_t_10 = __pyx_v_i;
24100 2373 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_10 * __pyx_v_u.strides[0]) )) = __pyx_v_min_diff;
24101 :
24102 : /* "scipy/sparse/csgraph/_matching.pyx":638
24103 : * min_diff = cc[t] - v[jp]
24104 : * u[i] = min_diff
24105 : * tp = first[i] # <<<<<<<<<<<<<<
24106 : * while kk[tp] != j1:
24107 : * tp += 1
24108 : */
24109 2373 : __pyx_t_10 = __pyx_v_i;
24110 2373 : __pyx_v_tp = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_first.data + __pyx_t_10 * __pyx_v_first.strides[0]) )));
24111 :
24112 : /* "scipy/sparse/csgraph/_matching.pyx":639
24113 : * u[i] = min_diff
24114 : * tp = first[i]
24115 : * while kk[tp] != j1: # <<<<<<<<<<<<<<
24116 : * tp += 1
24117 : * v[j1] = cc[tp] - min_diff
24118 : */
24119 14365 : while (1) {
24120 8369 : __pyx_t_10 = __pyx_v_tp;
24121 8369 : __pyx_t_12 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_kk.data + __pyx_t_10 * __pyx_v_kk.strides[0]) ))) != __pyx_v_j1);
24122 8369 : if (!__pyx_t_12) break;
24123 :
24124 : /* "scipy/sparse/csgraph/_matching.pyx":640
24125 : * tp = first[i]
24126 : * while kk[tp] != j1:
24127 : * tp += 1 # <<<<<<<<<<<<<<
24128 : * v[j1] = cc[tp] - min_diff
24129 : * else:
24130 : */
24131 5996 : __pyx_v_tp = (__pyx_v_tp + 1);
24132 : }
24133 :
24134 : /* "scipy/sparse/csgraph/_matching.pyx":641
24135 : * while kk[tp] != j1:
24136 : * tp += 1
24137 : * v[j1] = cc[tp] - min_diff # <<<<<<<<<<<<<<
24138 : * else:
24139 : * # The following two lines are swapped in the Pascal code: This
24140 : */
24141 2373 : __pyx_t_10 = __pyx_v_tp;
24142 2373 : __pyx_t_17 = __pyx_v_j1;
24143 2373 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) )) = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_cc.data + __pyx_t_10 * __pyx_v_cc.strides[0]) ))) - __pyx_v_min_diff);
24144 :
24145 : /* "scipy/sparse/csgraph/_matching.pyx":629
24146 : * if xinv[i] == 1:
24147 : * continue
24148 : * if x[i] != -1: # <<<<<<<<<<<<<<
24149 : * min_diff = INFINITY
24150 : * j1 = x[i]
24151 : */
24152 2373 : goto __pyx_L26;
24153 : }
24154 :
24155 : /* "scipy/sparse/csgraph/_matching.pyx":648
24156 : * # correspond to the 0 initialization in Pascal (as we recall
24157 : * # that all indices are shifted by one).
24158 : * free[lp] = i # <<<<<<<<<<<<<<
24159 : * lp += 1
24160 : * for _ in range(2):
24161 : */
24162 : /*else*/ {
24163 2349 : __pyx_t_10 = __pyx_v_lp;
24164 2349 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_free.data + __pyx_t_10 * __pyx_v_free.strides[0]) )) = __pyx_v_i;
24165 :
24166 : /* "scipy/sparse/csgraph/_matching.pyx":649
24167 : * # that all indices are shifted by one).
24168 : * free[lp] = i
24169 : * lp += 1 # <<<<<<<<<<<<<<
24170 : * for _ in range(2):
24171 : * h = 0
24172 : */
24173 2349 : __pyx_v_lp = (__pyx_v_lp + 1);
24174 : }
24175 6402 : __pyx_L26:;
24176 6402 : __pyx_L23_continue:;
24177 : }
24178 :
24179 : /* "scipy/sparse/csgraph/_matching.pyx":650
24180 : * free[lp] = i
24181 : * lp += 1
24182 : * for _ in range(2): # <<<<<<<<<<<<<<
24183 : * h = 0
24184 : * l0p = lp
24185 : */
24186 198 : for (__pyx_t_18 = 0; __pyx_t_18 < 2; __pyx_t_18+=1) {
24187 : __pyx_v__ = __pyx_t_18;
24188 :
24189 : /* "scipy/sparse/csgraph/_matching.pyx":651
24190 : * lp += 1
24191 : * for _ in range(2):
24192 : * h = 0 # <<<<<<<<<<<<<<
24193 : * l0p = lp
24194 : * lp = 0
24195 : */
24196 : __pyx_v_h = 0;
24197 :
24198 : /* "scipy/sparse/csgraph/_matching.pyx":652
24199 : * for _ in range(2):
24200 : * h = 0
24201 : * l0p = lp # <<<<<<<<<<<<<<
24202 : * lp = 0
24203 : * while h < l0p:
24204 : */
24205 : __pyx_v_l0p = __pyx_v_lp;
24206 :
24207 : /* "scipy/sparse/csgraph/_matching.pyx":653
24208 : * h = 0
24209 : * l0p = lp
24210 : * lp = 0 # <<<<<<<<<<<<<<
24211 : * while h < l0p:
24212 : * i = free[h]
24213 : */
24214 : __pyx_v_lp = 0;
24215 :
24216 : /* "scipy/sparse/csgraph/_matching.pyx":654
24217 : * l0p = lp
24218 : * lp = 0
24219 : * while h < l0p: # <<<<<<<<<<<<<<
24220 : * i = free[h]
24221 : * h += 1
24222 : */
24223 11502 : while (1) {
24224 11502 : __pyx_t_12 = (__pyx_v_h < __pyx_v_l0p);
24225 11502 : if (!__pyx_t_12) break;
24226 :
24227 : /* "scipy/sparse/csgraph/_matching.pyx":655
24228 : * lp = 0
24229 : * while h < l0p:
24230 : * i = free[h] # <<<<<<<<<<<<<<
24231 : * h += 1
24232 : * # Note: In the original Pascal code, the indices of the lowest
24233 : */
24234 11370 : __pyx_t_10 = __pyx_v_h;
24235 11370 : __pyx_v_i = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_free.data + __pyx_t_10 * __pyx_v_free.strides[0]) )));
24236 :
24237 : /* "scipy/sparse/csgraph/_matching.pyx":656
24238 : * while h < l0p:
24239 : * i = free[h]
24240 : * h += 1 # <<<<<<<<<<<<<<
24241 : * # Note: In the original Pascal code, the indices of the lowest
24242 : * # and second-lowest reduced costs are never reset. This can
24243 : */
24244 11370 : __pyx_v_h = (__pyx_v_h + 1);
24245 :
24246 : /* "scipy/sparse/csgraph/_matching.pyx":661
24247 : * # cause issues for infeasible problems; see
24248 : * # https://stackoverflow.com/q/62875232/5085211
24249 : * j0p = -1 # <<<<<<<<<<<<<<
24250 : * j1p = -1
24251 : * v0 = INFINITY
24252 : */
24253 11370 : __pyx_v_j0p = -1;
24254 :
24255 : /* "scipy/sparse/csgraph/_matching.pyx":662
24256 : * # https://stackoverflow.com/q/62875232/5085211
24257 : * j0p = -1
24258 : * j1p = -1 # <<<<<<<<<<<<<<
24259 : * v0 = INFINITY
24260 : * vj = INFINITY
24261 : */
24262 11370 : __pyx_v_j1p = -1;
24263 :
24264 : /* "scipy/sparse/csgraph/_matching.pyx":663
24265 : * j0p = -1
24266 : * j1p = -1
24267 : * v0 = INFINITY # <<<<<<<<<<<<<<
24268 : * vj = INFINITY
24269 : * for t in range(first[i], first[i + 1]):
24270 : */
24271 11370 : __pyx_v_v0 = INFINITY;
24272 :
24273 : /* "scipy/sparse/csgraph/_matching.pyx":664
24274 : * j1p = -1
24275 : * v0 = INFINITY
24276 : * vj = INFINITY # <<<<<<<<<<<<<<
24277 : * for t in range(first[i], first[i + 1]):
24278 : * jp = kk[t]
24279 : */
24280 11370 : __pyx_v_vj = INFINITY;
24281 :
24282 : /* "scipy/sparse/csgraph/_matching.pyx":665
24283 : * v0 = INFINITY
24284 : * vj = INFINITY
24285 : * for t in range(first[i], first[i + 1]): # <<<<<<<<<<<<<<
24286 : * jp = kk[t]
24287 : * dj = cc[t] - v[jp]
24288 : */
24289 11370 : __pyx_t_10 = (__pyx_v_i + 1);
24290 11370 : __pyx_t_7 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_first.data + __pyx_t_10 * __pyx_v_first.strides[0]) )));
24291 11370 : __pyx_t_10 = __pyx_v_i;
24292 11370 : __pyx_t_8 = __pyx_t_7;
24293 80641 : for (__pyx_t_9 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_first.data + __pyx_t_10 * __pyx_v_first.strides[0]) ))); __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
24294 69271 : __pyx_v_t = __pyx_t_9;
24295 :
24296 : /* "scipy/sparse/csgraph/_matching.pyx":666
24297 : * vj = INFINITY
24298 : * for t in range(first[i], first[i + 1]):
24299 : * jp = kk[t] # <<<<<<<<<<<<<<
24300 : * dj = cc[t] - v[jp]
24301 : * if dj < vj:
24302 : */
24303 69271 : __pyx_t_17 = __pyx_v_t;
24304 69271 : __pyx_v_jp = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_kk.data + __pyx_t_17 * __pyx_v_kk.strides[0]) )));
24305 :
24306 : /* "scipy/sparse/csgraph/_matching.pyx":667
24307 : * for t in range(first[i], first[i + 1]):
24308 : * jp = kk[t]
24309 : * dj = cc[t] - v[jp] # <<<<<<<<<<<<<<
24310 : * if dj < vj:
24311 : * if dj >= v0:
24312 : */
24313 69271 : __pyx_t_17 = __pyx_v_t;
24314 69271 : __pyx_t_16 = __pyx_v_jp;
24315 69271 : __pyx_v_dj = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_cc.data + __pyx_t_17 * __pyx_v_cc.strides[0]) ))) - (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))));
24316 :
24317 : /* "scipy/sparse/csgraph/_matching.pyx":668
24318 : * jp = kk[t]
24319 : * dj = cc[t] - v[jp]
24320 : * if dj < vj: # <<<<<<<<<<<<<<
24321 : * if dj >= v0:
24322 : * vj = dj
24323 : */
24324 69271 : __pyx_t_12 = (__pyx_v_dj < __pyx_v_vj);
24325 69271 : if (__pyx_t_12) {
24326 :
24327 : /* "scipy/sparse/csgraph/_matching.pyx":669
24328 : * dj = cc[t] - v[jp]
24329 : * if dj < vj:
24330 : * if dj >= v0: # <<<<<<<<<<<<<<
24331 : * vj = dj
24332 : * j1p = jp
24333 : */
24334 42878 : __pyx_t_12 = (__pyx_v_dj >= __pyx_v_v0);
24335 42878 : if (__pyx_t_12) {
24336 :
24337 : /* "scipy/sparse/csgraph/_matching.pyx":670
24338 : * if dj < vj:
24339 : * if dj >= v0:
24340 : * vj = dj # <<<<<<<<<<<<<<
24341 : * j1p = jp
24342 : * else:
24343 : */
24344 16328 : __pyx_v_vj = __pyx_v_dj;
24345 :
24346 : /* "scipy/sparse/csgraph/_matching.pyx":671
24347 : * if dj >= v0:
24348 : * vj = dj
24349 : * j1p = jp # <<<<<<<<<<<<<<
24350 : * else:
24351 : * vj = v0
24352 : */
24353 16328 : __pyx_v_j1p = __pyx_v_jp;
24354 :
24355 : /* "scipy/sparse/csgraph/_matching.pyx":669
24356 : * dj = cc[t] - v[jp]
24357 : * if dj < vj:
24358 : * if dj >= v0: # <<<<<<<<<<<<<<
24359 : * vj = dj
24360 : * j1p = jp
24361 : */
24362 16328 : goto __pyx_L40;
24363 : }
24364 :
24365 : /* "scipy/sparse/csgraph/_matching.pyx":673
24366 : * j1p = jp
24367 : * else:
24368 : * vj = v0 # <<<<<<<<<<<<<<
24369 : * v0 = dj
24370 : * j1p = j0p
24371 : */
24372 : /*else*/ {
24373 : __pyx_v_vj = __pyx_v_v0;
24374 :
24375 : /* "scipy/sparse/csgraph/_matching.pyx":674
24376 : * else:
24377 : * vj = v0
24378 : * v0 = dj # <<<<<<<<<<<<<<
24379 : * j1p = j0p
24380 : * j0p = jp
24381 : */
24382 : __pyx_v_v0 = __pyx_v_dj;
24383 :
24384 : /* "scipy/sparse/csgraph/_matching.pyx":675
24385 : * vj = v0
24386 : * v0 = dj
24387 : * j1p = j0p # <<<<<<<<<<<<<<
24388 : * j0p = jp
24389 : * # If the index of the column with the largest reduced cost has
24390 : */
24391 : __pyx_v_j1p = __pyx_v_j0p;
24392 :
24393 : /* "scipy/sparse/csgraph/_matching.pyx":676
24394 : * v0 = dj
24395 : * j1p = j0p
24396 : * j0p = jp # <<<<<<<<<<<<<<
24397 : * # If the index of the column with the largest reduced cost has
24398 : * # not been set, no assignment is possible for this row.
24399 : */
24400 : __pyx_v_j0p = __pyx_v_jp;
24401 : }
24402 69271 : __pyx_L40:;
24403 :
24404 : /* "scipy/sparse/csgraph/_matching.pyx":668
24405 : * jp = kk[t]
24406 : * dj = cc[t] - v[jp]
24407 : * if dj < vj: # <<<<<<<<<<<<<<
24408 : * if dj >= v0:
24409 : * vj = dj
24410 : */
24411 : }
24412 : }
24413 :
24414 : /* "scipy/sparse/csgraph/_matching.pyx":679
24415 : * # If the index of the column with the largest reduced cost has
24416 : * # not been set, no assignment is possible for this row.
24417 : * if j0p < 0: # <<<<<<<<<<<<<<
24418 : * raise ValueError('no full matching exists')
24419 : * i0 = y[j0p]
24420 : */
24421 11370 : __pyx_t_12 = (__pyx_v_j0p < 0);
24422 11370 : if (unlikely(__pyx_t_12)) {
24423 :
24424 : /* "scipy/sparse/csgraph/_matching.pyx":680
24425 : * # not been set, no assignment is possible for this row.
24426 : * if j0p < 0:
24427 : * raise ValueError('no full matching exists') # <<<<<<<<<<<<<<
24428 : * i0 = y[j0p]
24429 : * u[i] = vj
24430 : */
24431 0 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error)
24432 0 : __Pyx_GOTREF(__pyx_t_4);
24433 0 : __Pyx_Raise(__pyx_t_4, 0, 0, 0);
24434 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24435 0 : __PYX_ERR(0, 680, __pyx_L1_error)
24436 :
24437 : /* "scipy/sparse/csgraph/_matching.pyx":679
24438 : * # If the index of the column with the largest reduced cost has
24439 : * # not been set, no assignment is possible for this row.
24440 : * if j0p < 0: # <<<<<<<<<<<<<<
24441 : * raise ValueError('no full matching exists')
24442 : * i0 = y[j0p]
24443 : */
24444 : }
24445 :
24446 : /* "scipy/sparse/csgraph/_matching.pyx":681
24447 : * if j0p < 0:
24448 : * raise ValueError('no full matching exists')
24449 : * i0 = y[j0p] # <<<<<<<<<<<<<<
24450 : * u[i] = vj
24451 : * if v0 < vj:
24452 : */
24453 11370 : __pyx_t_10 = __pyx_v_j0p;
24454 11370 : __pyx_v_i0 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_10 * __pyx_v_y.strides[0]) )));
24455 :
24456 : /* "scipy/sparse/csgraph/_matching.pyx":682
24457 : * raise ValueError('no full matching exists')
24458 : * i0 = y[j0p]
24459 : * u[i] = vj # <<<<<<<<<<<<<<
24460 : * if v0 < vj:
24461 : * v[j0p] += v0 - vj
24462 : */
24463 11370 : __pyx_t_10 = __pyx_v_i;
24464 11370 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_10 * __pyx_v_u.strides[0]) )) = __pyx_v_vj;
24465 :
24466 : /* "scipy/sparse/csgraph/_matching.pyx":683
24467 : * i0 = y[j0p]
24468 : * u[i] = vj
24469 : * if v0 < vj: # <<<<<<<<<<<<<<
24470 : * v[j0p] += v0 - vj
24471 : * elif i0 != -1:
24472 : */
24473 11370 : __pyx_t_12 = (__pyx_v_v0 < __pyx_v_vj);
24474 11370 : if (__pyx_t_12) {
24475 :
24476 : /* "scipy/sparse/csgraph/_matching.pyx":684
24477 : * u[i] = vj
24478 : * if v0 < vj:
24479 : * v[j0p] += v0 - vj # <<<<<<<<<<<<<<
24480 : * elif i0 != -1:
24481 : * j0p = j1p
24482 : */
24483 10639 : __pyx_t_10 = __pyx_v_j0p;
24484 10639 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_10 * __pyx_v_v.strides[0]) )) += (__pyx_v_v0 - __pyx_v_vj);
24485 :
24486 : /* "scipy/sparse/csgraph/_matching.pyx":683
24487 : * i0 = y[j0p]
24488 : * u[i] = vj
24489 : * if v0 < vj: # <<<<<<<<<<<<<<
24490 : * v[j0p] += v0 - vj
24491 : * elif i0 != -1:
24492 : */
24493 10639 : goto __pyx_L42;
24494 : }
24495 :
24496 : /* "scipy/sparse/csgraph/_matching.pyx":685
24497 : * if v0 < vj:
24498 : * v[j0p] += v0 - vj
24499 : * elif i0 != -1: # <<<<<<<<<<<<<<
24500 : * j0p = j1p
24501 : * i0 = y[j0p]
24502 : */
24503 731 : __pyx_t_12 = (__pyx_v_i0 != -1L);
24504 731 : if (__pyx_t_12) {
24505 :
24506 : /* "scipy/sparse/csgraph/_matching.pyx":686
24507 : * v[j0p] += v0 - vj
24508 : * elif i0 != -1:
24509 : * j0p = j1p # <<<<<<<<<<<<<<
24510 : * i0 = y[j0p]
24511 : * x[i] = j0p
24512 : */
24513 487 : __pyx_v_j0p = __pyx_v_j1p;
24514 :
24515 : /* "scipy/sparse/csgraph/_matching.pyx":687
24516 : * elif i0 != -1:
24517 : * j0p = j1p
24518 : * i0 = y[j0p] # <<<<<<<<<<<<<<
24519 : * x[i] = j0p
24520 : * y[j0p] = i
24521 : */
24522 487 : __pyx_t_10 = __pyx_v_j0p;
24523 487 : __pyx_v_i0 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_10 * __pyx_v_y.strides[0]) )));
24524 :
24525 : /* "scipy/sparse/csgraph/_matching.pyx":685
24526 : * if v0 < vj:
24527 : * v[j0p] += v0 - vj
24528 : * elif i0 != -1: # <<<<<<<<<<<<<<
24529 : * j0p = j1p
24530 : * i0 = y[j0p]
24531 : */
24532 : }
24533 244 : __pyx_L42:;
24534 :
24535 : /* "scipy/sparse/csgraph/_matching.pyx":688
24536 : * j0p = j1p
24537 : * i0 = y[j0p]
24538 : * x[i] = j0p # <<<<<<<<<<<<<<
24539 : * y[j0p] = i
24540 : * if i0 != -1:
24541 : */
24542 11370 : __pyx_t_10 = __pyx_v_i;
24543 11370 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_10 * __pyx_v_x.strides[0]) )) = __pyx_v_j0p;
24544 :
24545 : /* "scipy/sparse/csgraph/_matching.pyx":689
24546 : * i0 = y[j0p]
24547 : * x[i] = j0p
24548 : * y[j0p] = i # <<<<<<<<<<<<<<
24549 : * if i0 != -1:
24550 : * if v0 < vj:
24551 : */
24552 11370 : __pyx_t_10 = __pyx_v_j0p;
24553 11370 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_10 * __pyx_v_y.strides[0]) )) = __pyx_v_i;
24554 :
24555 : /* "scipy/sparse/csgraph/_matching.pyx":690
24556 : * x[i] = j0p
24557 : * y[j0p] = i
24558 : * if i0 != -1: # <<<<<<<<<<<<<<
24559 : * if v0 < vj:
24560 : * h -= 1
24561 : */
24562 11370 : __pyx_t_12 = (__pyx_v_i0 != -1L);
24563 11370 : if (__pyx_t_12) {
24564 :
24565 : /* "scipy/sparse/csgraph/_matching.pyx":691
24566 : * y[j0p] = i
24567 : * if i0 != -1:
24568 : * if v0 < vj: # <<<<<<<<<<<<<<
24569 : * h -= 1
24570 : * free[h] = i0
24571 : */
24572 9211 : __pyx_t_12 = (__pyx_v_v0 < __pyx_v_vj);
24573 9211 : if (__pyx_t_12) {
24574 :
24575 : /* "scipy/sparse/csgraph/_matching.pyx":692
24576 : * if i0 != -1:
24577 : * if v0 < vj:
24578 : * h -= 1 # <<<<<<<<<<<<<<
24579 : * free[h] = i0
24580 : * else:
24581 : */
24582 8757 : __pyx_v_h = (__pyx_v_h - 1);
24583 :
24584 : /* "scipy/sparse/csgraph/_matching.pyx":693
24585 : * if v0 < vj:
24586 : * h -= 1
24587 : * free[h] = i0 # <<<<<<<<<<<<<<
24588 : * else:
24589 : * free[lp] = i0
24590 : */
24591 8757 : __pyx_t_10 = __pyx_v_h;
24592 8757 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_free.data + __pyx_t_10 * __pyx_v_free.strides[0]) )) = __pyx_v_i0;
24593 :
24594 : /* "scipy/sparse/csgraph/_matching.pyx":691
24595 : * y[j0p] = i
24596 : * if i0 != -1:
24597 : * if v0 < vj: # <<<<<<<<<<<<<<
24598 : * h -= 1
24599 : * free[h] = i0
24600 : */
24601 8757 : goto __pyx_L44;
24602 : }
24603 :
24604 : /* "scipy/sparse/csgraph/_matching.pyx":695
24605 : * free[h] = i0
24606 : * else:
24607 : * free[lp] = i0 # <<<<<<<<<<<<<<
24608 : * lp += 1
24609 : * l0 = lp
24610 : */
24611 : /*else*/ {
24612 454 : __pyx_t_10 = __pyx_v_lp;
24613 454 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_free.data + __pyx_t_10 * __pyx_v_free.strides[0]) )) = __pyx_v_i0;
24614 :
24615 : /* "scipy/sparse/csgraph/_matching.pyx":696
24616 : * else:
24617 : * free[lp] = i0
24618 : * lp += 1 # <<<<<<<<<<<<<<
24619 : * l0 = lp
24620 : * else:
24621 : */
24622 454 : __pyx_v_lp = (__pyx_v_lp + 1);
24623 : }
24624 : __pyx_L44:;
24625 :
24626 : /* "scipy/sparse/csgraph/_matching.pyx":690
24627 : * x[i] = j0p
24628 : * y[j0p] = i
24629 : * if i0 != -1: # <<<<<<<<<<<<<<
24630 : * if v0 < vj:
24631 : * h -= 1
24632 : */
24633 : }
24634 : }
24635 : }
24636 :
24637 : /* "scipy/sparse/csgraph/_matching.pyx":697
24638 : * free[lp] = i0
24639 : * lp += 1
24640 : * l0 = lp # <<<<<<<<<<<<<<
24641 : * else:
24642 : * l0 = nr
24643 : */
24644 66 : __pyx_v_l0 = __pyx_v_lp;
24645 :
24646 : /* "scipy/sparse/csgraph/_matching.pyx":601
24647 : * # We skip the initialization entirely in the non-square case and instead
24648 : * # fill all of `free` explicitly.
24649 : * if nr == nc: # <<<<<<<<<<<<<<
24650 : * # From here, proceed from line 55 in the original Pascal code, LAPJVS.P
24651 : * for jp in range(nc):
24652 : */
24653 66 : goto __pyx_L11;
24654 : }
24655 :
24656 : /* "scipy/sparse/csgraph/_matching.pyx":699
24657 : * l0 = lp
24658 : * else:
24659 : * l0 = nr # <<<<<<<<<<<<<<
24660 : * for i in range(nr):
24661 : * free[i] = i
24662 : */
24663 : /*else*/ {
24664 2 : __pyx_v_l0 = __pyx_v_nr;
24665 :
24666 : /* "scipy/sparse/csgraph/_matching.pyx":700
24667 : * else:
24668 : * l0 = nr
24669 : * for i in range(nr): # <<<<<<<<<<<<<<
24670 : * free[i] = i
24671 : *
24672 : */
24673 2 : __pyx_t_7 = __pyx_v_nr;
24674 2 : __pyx_t_8 = __pyx_t_7;
24675 2 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
24676 0 : __pyx_v_i = __pyx_t_9;
24677 :
24678 : /* "scipy/sparse/csgraph/_matching.pyx":701
24679 : * l0 = nr
24680 : * for i in range(nr):
24681 : * free[i] = i # <<<<<<<<<<<<<<
24682 : *
24683 : * # In the original Pascal code, the solution for each l is inlined,
24684 : */
24685 0 : __pyx_t_10 = __pyx_v_i;
24686 0 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_free.data + __pyx_t_10 * __pyx_v_free.strides[0]) )) = __pyx_v_i;
24687 : }
24688 : }
24689 2 : __pyx_L11:;
24690 :
24691 : /* "scipy/sparse/csgraph/_matching.pyx":708
24692 : * # function thus corresponds to lines 109--154 in the Pascal code,
24693 : * # with lines 155 and 156 separated into two separate functions below.
24694 : * td1 = -1 # <<<<<<<<<<<<<<
24695 : * for l in range(l0):
24696 : * td1 = _lapjvsp_single_l(l, nc, d, ok, free, first, kk, cc, v, lab,
24697 : */
24698 68 : __pyx_v_td1 = -1;
24699 :
24700 : /* "scipy/sparse/csgraph/_matching.pyx":709
24701 : * # with lines 155 and 156 separated into two separate functions below.
24702 : * td1 = -1
24703 : * for l in range(l0): # <<<<<<<<<<<<<<
24704 : * td1 = _lapjvsp_single_l(l, nc, d, ok, free, first, kk, cc, v, lab,
24705 : * todo, y, x, td1)
24706 : */
24707 68 : __pyx_t_7 = __pyx_v_l0;
24708 68 : __pyx_t_8 = __pyx_t_7;
24709 258 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
24710 190 : __pyx_v_l = __pyx_t_9;
24711 :
24712 : /* "scipy/sparse/csgraph/_matching.pyx":710
24713 : * td1 = -1
24714 : * for l in range(l0):
24715 : * td1 = _lapjvsp_single_l(l, nc, d, ok, free, first, kk, cc, v, lab, # <<<<<<<<<<<<<<
24716 : * todo, y, x, td1)
24717 : * return x
24718 : */
24719 190 : __pyx_t_13 = __pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp_single_l(__pyx_v_l, __pyx_v_nc, __pyx_v_d, __pyx_v_ok, __pyx_v_free, __pyx_v_first, __pyx_v_kk, __pyx_v_cc, __pyx_v_v, __pyx_v_lab, __pyx_v_todo, __pyx_v_y, __pyx_v_x, __pyx_v_td1); if (unlikely(__pyx_t_13 == ((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t)-2))) __PYX_ERR(0, 710, __pyx_L1_error)
24720 190 : __pyx_v_td1 = __pyx_t_13;
24721 : }
24722 :
24723 : /* "scipy/sparse/csgraph/_matching.pyx":712
24724 : * td1 = _lapjvsp_single_l(l, nc, d, ok, free, first, kk, cc, v, lab,
24725 : * todo, y, x, td1)
24726 : * return x # <<<<<<<<<<<<<<
24727 : *
24728 : *
24729 : */
24730 68 : __PYX_INC_MEMVIEW(&__pyx_v_x, 1);
24731 68 : __pyx_r = __pyx_v_x;
24732 68 : goto __pyx_L0;
24733 :
24734 : /* "scipy/sparse/csgraph/_matching.pyx":528
24735 : * @cython.boundscheck(False)
24736 : * @cython.wraparound(False)
24737 : * cdef ITYPE_t[:] _lapjvsp(ITYPE_t[:] first, # <<<<<<<<<<<<<<
24738 : * ITYPE_t[:] kk,
24739 : * DTYPE_t[:] cc,
24740 : */
24741 :
24742 : /* function exit code */
24743 0 : __pyx_L1_error:;
24744 0 : __Pyx_XDECREF(__pyx_t_1);
24745 0 : __Pyx_XDECREF(__pyx_t_2);
24746 0 : __Pyx_XDECREF(__pyx_t_3);
24747 0 : __Pyx_XDECREF(__pyx_t_4);
24748 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
24749 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
24750 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
24751 0 : __pyx_r.data = NULL;
24752 0 : __pyx_r.memview = NULL;
24753 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._matching._lapjvsp", __pyx_clineno, __pyx_lineno, __pyx_filename);
24754 0 : goto __pyx_L2;
24755 68 : __pyx_L0:;
24756 68 : if (unlikely(!__pyx_r.memview)) {
24757 0 : PyErr_SetString(PyExc_TypeError, "Memoryview return value is not initialized");
24758 : }
24759 68 : __pyx_L2:;
24760 68 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_v, 1);
24761 68 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
24762 68 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_y, 1);
24763 68 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_u, 1);
24764 68 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_d, 1);
24765 68 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_ok, 1);
24766 68 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_xinv, 1);
24767 68 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_free, 1);
24768 68 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_todo, 1);
24769 68 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_lab, 1);
24770 68 : __Pyx_RefNannyFinishContext();
24771 68 : return __pyx_r;
24772 : }
24773 :
24774 : /* "scipy/sparse/csgraph/_matching.pyx":717
24775 : * @cython.boundscheck(False)
24776 : * @cython.wraparound(False)
24777 : * cdef ITYPE_t _lapjvsp_single_l(ITYPE_t l, ITYPE_t nc, DTYPE_t[:] d, # <<<<<<<<<<<<<<
24778 : * BTYPE_t[:] ok, ITYPE_t[:] free,
24779 : * ITYPE_t[:] first, ITYPE_t[:] kk,
24780 : */
24781 :
24782 190 : static __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp_single_l(__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_l, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_nc, __Pyx_memviewslice __pyx_v_d, __Pyx_memviewslice __pyx_v_ok, __Pyx_memviewslice __pyx_v_free, __Pyx_memviewslice __pyx_v_first, __Pyx_memviewslice __pyx_v_kk, __Pyx_memviewslice __pyx_v_cc, __Pyx_memviewslice __pyx_v_v, __Pyx_memviewslice __pyx_v_lab, __Pyx_memviewslice __pyx_v_todo, __Pyx_memviewslice __pyx_v_y, __Pyx_memviewslice __pyx_v_x, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_td1) {
24783 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_jp;
24784 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_i0;
24785 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_j;
24786 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_t;
24787 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_td2;
24788 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_hp;
24789 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_last;
24790 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_j0;
24791 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_i;
24792 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_tp;
24793 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t __pyx_v_min_diff;
24794 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t __pyx_v_dj;
24795 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t __pyx_v_h;
24796 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t __pyx_v_vj;
24797 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_r;
24798 : __Pyx_RefNannyDeclarations
24799 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_1;
24800 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_2;
24801 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_3;
24802 190 : Py_ssize_t __pyx_t_4;
24803 190 : Py_ssize_t __pyx_t_5;
24804 190 : Py_ssize_t __pyx_t_6;
24805 190 : int __pyx_t_7;
24806 190 : long __pyx_t_8;
24807 190 : long __pyx_t_9;
24808 190 : PyObject *__pyx_t_10 = NULL;
24809 190 : int __pyx_t_11;
24810 190 : int __pyx_lineno = 0;
24811 190 : const char *__pyx_filename = NULL;
24812 190 : int __pyx_clineno = 0;
24813 190 : __Pyx_RefNannySetupContext("_lapjvsp_single_l", 1);
24814 :
24815 : /* "scipy/sparse/csgraph/_matching.pyx":726
24816 : * cdef DTYPE_t min_diff, dj, h, vj
24817 : *
24818 : * for jp in range(nc): # <<<<<<<<<<<<<<
24819 : * d[jp] = INFINITY
24820 : * ok[jp] = 0
24821 : */
24822 190 : __pyx_t_1 = __pyx_v_nc;
24823 190 : __pyx_t_2 = __pyx_t_1;
24824 19190 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24825 19000 : __pyx_v_jp = __pyx_t_3;
24826 :
24827 : /* "scipy/sparse/csgraph/_matching.pyx":727
24828 : *
24829 : * for jp in range(nc):
24830 : * d[jp] = INFINITY # <<<<<<<<<<<<<<
24831 : * ok[jp] = 0
24832 : * min_diff = INFINITY
24833 : */
24834 19000 : __pyx_t_4 = __pyx_v_jp;
24835 19000 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_d.data + __pyx_t_4 * __pyx_v_d.strides[0]) )) = INFINITY;
24836 :
24837 : /* "scipy/sparse/csgraph/_matching.pyx":728
24838 : * for jp in range(nc):
24839 : * d[jp] = INFINITY
24840 : * ok[jp] = 0 # <<<<<<<<<<<<<<
24841 : * min_diff = INFINITY
24842 : * i0 = free[l]
24843 : */
24844 19000 : __pyx_t_4 = __pyx_v_jp;
24845 19000 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t *) ( /* dim=0 */ (__pyx_v_ok.data + __pyx_t_4 * __pyx_v_ok.strides[0]) )) = 0;
24846 : }
24847 :
24848 : /* "scipy/sparse/csgraph/_matching.pyx":729
24849 : * d[jp] = INFINITY
24850 : * ok[jp] = 0
24851 : * min_diff = INFINITY # <<<<<<<<<<<<<<
24852 : * i0 = free[l]
24853 : *
24854 : */
24855 190 : __pyx_v_min_diff = INFINITY;
24856 :
24857 : /* "scipy/sparse/csgraph/_matching.pyx":730
24858 : * ok[jp] = 0
24859 : * min_diff = INFINITY
24860 : * i0 = free[l] # <<<<<<<<<<<<<<
24861 : *
24862 : * for t in range(first[i0], first[i0 + 1]):
24863 : */
24864 190 : __pyx_t_4 = __pyx_v_l;
24865 190 : __pyx_v_i0 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_free.data + __pyx_t_4 * __pyx_v_free.strides[0]) )));
24866 :
24867 : /* "scipy/sparse/csgraph/_matching.pyx":732
24868 : * i0 = free[l]
24869 : *
24870 : * for t in range(first[i0], first[i0 + 1]): # <<<<<<<<<<<<<<
24871 : * j = kk[t]
24872 : * dj = cc[t] - v[j]
24873 : */
24874 190 : __pyx_t_4 = (__pyx_v_i0 + 1);
24875 190 : __pyx_t_1 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_first.data + __pyx_t_4 * __pyx_v_first.strides[0]) )));
24876 190 : __pyx_t_4 = __pyx_v_i0;
24877 190 : __pyx_t_2 = __pyx_t_1;
24878 1386 : for (__pyx_t_3 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_first.data + __pyx_t_4 * __pyx_v_first.strides[0]) ))); __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24879 1196 : __pyx_v_t = __pyx_t_3;
24880 :
24881 : /* "scipy/sparse/csgraph/_matching.pyx":733
24882 : *
24883 : * for t in range(first[i0], first[i0 + 1]):
24884 : * j = kk[t] # <<<<<<<<<<<<<<
24885 : * dj = cc[t] - v[j]
24886 : * d[j] = dj
24887 : */
24888 1196 : __pyx_t_5 = __pyx_v_t;
24889 1196 : __pyx_v_j = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_kk.data + __pyx_t_5 * __pyx_v_kk.strides[0]) )));
24890 :
24891 : /* "scipy/sparse/csgraph/_matching.pyx":734
24892 : * for t in range(first[i0], first[i0 + 1]):
24893 : * j = kk[t]
24894 : * dj = cc[t] - v[j] # <<<<<<<<<<<<<<
24895 : * d[j] = dj
24896 : * lab[j] = i0
24897 : */
24898 1196 : __pyx_t_5 = __pyx_v_t;
24899 1196 : __pyx_t_6 = __pyx_v_j;
24900 1196 : __pyx_v_dj = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_cc.data + __pyx_t_5 * __pyx_v_cc.strides[0]) ))) - (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_6 * __pyx_v_v.strides[0]) ))));
24901 :
24902 : /* "scipy/sparse/csgraph/_matching.pyx":735
24903 : * j = kk[t]
24904 : * dj = cc[t] - v[j]
24905 : * d[j] = dj # <<<<<<<<<<<<<<
24906 : * lab[j] = i0
24907 : * if dj <= min_diff:
24908 : */
24909 1196 : __pyx_t_6 = __pyx_v_j;
24910 1196 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_d.data + __pyx_t_6 * __pyx_v_d.strides[0]) )) = __pyx_v_dj;
24911 :
24912 : /* "scipy/sparse/csgraph/_matching.pyx":736
24913 : * dj = cc[t] - v[j]
24914 : * d[j] = dj
24915 : * lab[j] = i0 # <<<<<<<<<<<<<<
24916 : * if dj <= min_diff:
24917 : * if dj < min_diff:
24918 : */
24919 1196 : __pyx_t_6 = __pyx_v_j;
24920 1196 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_lab.data + __pyx_t_6 * __pyx_v_lab.strides[0]) )) = __pyx_v_i0;
24921 :
24922 : /* "scipy/sparse/csgraph/_matching.pyx":737
24923 : * d[j] = dj
24924 : * lab[j] = i0
24925 : * if dj <= min_diff: # <<<<<<<<<<<<<<
24926 : * if dj < min_diff:
24927 : * td1 = -1
24928 : */
24929 1196 : __pyx_t_7 = (__pyx_v_dj <= __pyx_v_min_diff);
24930 1196 : if (__pyx_t_7) {
24931 :
24932 : /* "scipy/sparse/csgraph/_matching.pyx":738
24933 : * lab[j] = i0
24934 : * if dj <= min_diff:
24935 : * if dj < min_diff: # <<<<<<<<<<<<<<
24936 : * td1 = -1
24937 : * min_diff = dj
24938 : */
24939 587 : __pyx_t_7 = (__pyx_v_dj < __pyx_v_min_diff);
24940 587 : if (__pyx_t_7) {
24941 :
24942 : /* "scipy/sparse/csgraph/_matching.pyx":739
24943 : * if dj <= min_diff:
24944 : * if dj < min_diff:
24945 : * td1 = -1 # <<<<<<<<<<<<<<
24946 : * min_diff = dj
24947 : * td1 += 1
24948 : */
24949 465 : __pyx_v_td1 = -1;
24950 :
24951 : /* "scipy/sparse/csgraph/_matching.pyx":740
24952 : * if dj < min_diff:
24953 : * td1 = -1
24954 : * min_diff = dj # <<<<<<<<<<<<<<
24955 : * td1 += 1
24956 : * todo[td1] = j
24957 : */
24958 465 : __pyx_v_min_diff = __pyx_v_dj;
24959 :
24960 : /* "scipy/sparse/csgraph/_matching.pyx":738
24961 : * lab[j] = i0
24962 : * if dj <= min_diff:
24963 : * if dj < min_diff: # <<<<<<<<<<<<<<
24964 : * td1 = -1
24965 : * min_diff = dj
24966 : */
24967 : }
24968 :
24969 : /* "scipy/sparse/csgraph/_matching.pyx":741
24970 : * td1 = -1
24971 : * min_diff = dj
24972 : * td1 += 1 # <<<<<<<<<<<<<<
24973 : * todo[td1] = j
24974 : *
24975 : */
24976 587 : __pyx_v_td1 = (__pyx_v_td1 + 1);
24977 :
24978 : /* "scipy/sparse/csgraph/_matching.pyx":742
24979 : * min_diff = dj
24980 : * td1 += 1
24981 : * todo[td1] = j # <<<<<<<<<<<<<<
24982 : *
24983 : * for hp in range(td1 + 1):
24984 : */
24985 587 : __pyx_t_6 = __pyx_v_td1;
24986 587 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_todo.data + __pyx_t_6 * __pyx_v_todo.strides[0]) )) = __pyx_v_j;
24987 :
24988 : /* "scipy/sparse/csgraph/_matching.pyx":737
24989 : * d[j] = dj
24990 : * lab[j] = i0
24991 : * if dj <= min_diff: # <<<<<<<<<<<<<<
24992 : * if dj < min_diff:
24993 : * td1 = -1
24994 : */
24995 : }
24996 : }
24997 :
24998 : /* "scipy/sparse/csgraph/_matching.pyx":744
24999 : * todo[td1] = j
25000 : *
25001 : * for hp in range(td1 + 1): # <<<<<<<<<<<<<<
25002 : * j = todo[hp]
25003 : * if y[j] == -1:
25004 : */
25005 190 : __pyx_t_8 = (__pyx_v_td1 + 1);
25006 190 : __pyx_t_9 = __pyx_t_8;
25007 484 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_9; __pyx_t_1+=1) {
25008 297 : __pyx_v_hp = __pyx_t_1;
25009 :
25010 : /* "scipy/sparse/csgraph/_matching.pyx":745
25011 : *
25012 : * for hp in range(td1 + 1):
25013 : * j = todo[hp] # <<<<<<<<<<<<<<
25014 : * if y[j] == -1:
25015 : * _lapjvsp_update_assignments(lab, y, x, j, i0)
25016 : */
25017 297 : __pyx_t_4 = __pyx_v_hp;
25018 297 : __pyx_v_j = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_todo.data + __pyx_t_4 * __pyx_v_todo.strides[0]) )));
25019 :
25020 : /* "scipy/sparse/csgraph/_matching.pyx":746
25021 : * for hp in range(td1 + 1):
25022 : * j = todo[hp]
25023 : * if y[j] == -1: # <<<<<<<<<<<<<<
25024 : * _lapjvsp_update_assignments(lab, y, x, j, i0)
25025 : * return td1
25026 : */
25027 297 : __pyx_t_4 = __pyx_v_j;
25028 297 : __pyx_t_7 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_4 * __pyx_v_y.strides[0]) ))) == -1L);
25029 297 : if (__pyx_t_7) {
25030 :
25031 : /* "scipy/sparse/csgraph/_matching.pyx":747
25032 : * j = todo[hp]
25033 : * if y[j] == -1:
25034 : * _lapjvsp_update_assignments(lab, y, x, j, i0) # <<<<<<<<<<<<<<
25035 : * return td1
25036 : * ok[j] = 1
25037 : */
25038 6 : __pyx_t_10 = __pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp_update_assignments(__pyx_v_lab, __pyx_v_y, __pyx_v_x, __pyx_v_j, __pyx_v_i0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 747, __pyx_L1_error)
25039 3 : __Pyx_GOTREF(__pyx_t_10);
25040 6 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25041 :
25042 : /* "scipy/sparse/csgraph/_matching.pyx":748
25043 : * if y[j] == -1:
25044 : * _lapjvsp_update_assignments(lab, y, x, j, i0)
25045 : * return td1 # <<<<<<<<<<<<<<
25046 : * ok[j] = 1
25047 : * td2 = nc - 1
25048 : */
25049 3 : __pyx_r = __pyx_v_td1;
25050 3 : goto __pyx_L0;
25051 :
25052 : /* "scipy/sparse/csgraph/_matching.pyx":746
25053 : * for hp in range(td1 + 1):
25054 : * j = todo[hp]
25055 : * if y[j] == -1: # <<<<<<<<<<<<<<
25056 : * _lapjvsp_update_assignments(lab, y, x, j, i0)
25057 : * return td1
25058 : */
25059 : }
25060 :
25061 : /* "scipy/sparse/csgraph/_matching.pyx":749
25062 : * _lapjvsp_update_assignments(lab, y, x, j, i0)
25063 : * return td1
25064 : * ok[j] = 1 # <<<<<<<<<<<<<<
25065 : * td2 = nc - 1
25066 : * last = nc
25067 : */
25068 294 : __pyx_t_4 = __pyx_v_j;
25069 294 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t *) ( /* dim=0 */ (__pyx_v_ok.data + __pyx_t_4 * __pyx_v_ok.strides[0]) )) = 1;
25070 : }
25071 :
25072 : /* "scipy/sparse/csgraph/_matching.pyx":750
25073 : * return td1
25074 : * ok[j] = 1
25075 : * td2 = nc - 1 # <<<<<<<<<<<<<<
25076 : * last = nc
25077 : *
25078 : */
25079 187 : __pyx_v_td2 = (__pyx_v_nc - 1);
25080 :
25081 : /* "scipy/sparse/csgraph/_matching.pyx":751
25082 : * ok[j] = 1
25083 : * td2 = nc - 1
25084 : * last = nc # <<<<<<<<<<<<<<
25085 : *
25086 : * while True:
25087 : */
25088 187 : __pyx_v_last = __pyx_v_nc;
25089 :
25090 : /* "scipy/sparse/csgraph/_matching.pyx":753
25091 : * last = nc
25092 : *
25093 : * while True: # <<<<<<<<<<<<<<
25094 : * # If td1 is negative at this point, that corresponds to no assignments
25095 : * # having been made in the previous run, so no full matching exists
25096 : */
25097 6703 : while (1) {
25098 :
25099 : /* "scipy/sparse/csgraph/_matching.pyx":757
25100 : * # having been made in the previous run, so no full matching exists
25101 : * # and we error out.
25102 : * if td1 < 0: # <<<<<<<<<<<<<<
25103 : * raise ValueError('no full matching exists')
25104 : * j0 = todo[td1]
25105 : */
25106 6703 : __pyx_t_7 = (__pyx_v_td1 < 0);
25107 6703 : if (unlikely(__pyx_t_7)) {
25108 :
25109 : /* "scipy/sparse/csgraph/_matching.pyx":758
25110 : * # and we error out.
25111 : * if td1 < 0:
25112 : * raise ValueError('no full matching exists') # <<<<<<<<<<<<<<
25113 : * j0 = todo[td1]
25114 : * td1 -= 1
25115 : */
25116 0 : __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 758, __pyx_L1_error)
25117 0 : __Pyx_GOTREF(__pyx_t_10);
25118 0 : __Pyx_Raise(__pyx_t_10, 0, 0, 0);
25119 0 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25120 0 : __PYX_ERR(0, 758, __pyx_L1_error)
25121 :
25122 : /* "scipy/sparse/csgraph/_matching.pyx":757
25123 : * # having been made in the previous run, so no full matching exists
25124 : * # and we error out.
25125 : * if td1 < 0: # <<<<<<<<<<<<<<
25126 : * raise ValueError('no full matching exists')
25127 : * j0 = todo[td1]
25128 : */
25129 : }
25130 :
25131 : /* "scipy/sparse/csgraph/_matching.pyx":759
25132 : * if td1 < 0:
25133 : * raise ValueError('no full matching exists')
25134 : * j0 = todo[td1] # <<<<<<<<<<<<<<
25135 : * td1 -= 1
25136 : * i = y[j0]
25137 : */
25138 6703 : __pyx_t_4 = __pyx_v_td1;
25139 6703 : __pyx_v_j0 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_todo.data + __pyx_t_4 * __pyx_v_todo.strides[0]) )));
25140 :
25141 : /* "scipy/sparse/csgraph/_matching.pyx":760
25142 : * raise ValueError('no full matching exists')
25143 : * j0 = todo[td1]
25144 : * td1 -= 1 # <<<<<<<<<<<<<<
25145 : * i = y[j0]
25146 : * todo[td2] = j0
25147 : */
25148 6703 : __pyx_v_td1 = (__pyx_v_td1 - 1);
25149 :
25150 : /* "scipy/sparse/csgraph/_matching.pyx":761
25151 : * j0 = todo[td1]
25152 : * td1 -= 1
25153 : * i = y[j0] # <<<<<<<<<<<<<<
25154 : * todo[td2] = j0
25155 : * td2 -= 1
25156 : */
25157 6703 : __pyx_t_4 = __pyx_v_j0;
25158 6703 : __pyx_v_i = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_4 * __pyx_v_y.strides[0]) )));
25159 :
25160 : /* "scipy/sparse/csgraph/_matching.pyx":762
25161 : * td1 -= 1
25162 : * i = y[j0]
25163 : * todo[td2] = j0 # <<<<<<<<<<<<<<
25164 : * td2 -= 1
25165 : * tp = first[i]
25166 : */
25167 6703 : __pyx_t_4 = __pyx_v_td2;
25168 6703 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_todo.data + __pyx_t_4 * __pyx_v_todo.strides[0]) )) = __pyx_v_j0;
25169 :
25170 : /* "scipy/sparse/csgraph/_matching.pyx":763
25171 : * i = y[j0]
25172 : * todo[td2] = j0
25173 : * td2 -= 1 # <<<<<<<<<<<<<<
25174 : * tp = first[i]
25175 : * while kk[tp] != j0:
25176 : */
25177 6703 : __pyx_v_td2 = (__pyx_v_td2 - 1);
25178 :
25179 : /* "scipy/sparse/csgraph/_matching.pyx":764
25180 : * todo[td2] = j0
25181 : * td2 -= 1
25182 : * tp = first[i] # <<<<<<<<<<<<<<
25183 : * while kk[tp] != j0:
25184 : * tp += 1
25185 : */
25186 6703 : __pyx_t_4 = __pyx_v_i;
25187 6703 : __pyx_v_tp = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_first.data + __pyx_t_4 * __pyx_v_first.strides[0]) )));
25188 :
25189 : /* "scipy/sparse/csgraph/_matching.pyx":765
25190 : * td2 -= 1
25191 : * tp = first[i]
25192 : * while kk[tp] != j0: # <<<<<<<<<<<<<<
25193 : * tp += 1
25194 : * h = cc[tp] - v[j0] - min_diff
25195 : */
25196 42207 : while (1) {
25197 24455 : __pyx_t_4 = __pyx_v_tp;
25198 24455 : __pyx_t_7 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_kk.data + __pyx_t_4 * __pyx_v_kk.strides[0]) ))) != __pyx_v_j0);
25199 24455 : if (!__pyx_t_7) break;
25200 :
25201 : /* "scipy/sparse/csgraph/_matching.pyx":766
25202 : * tp = first[i]
25203 : * while kk[tp] != j0:
25204 : * tp += 1 # <<<<<<<<<<<<<<
25205 : * h = cc[tp] - v[j0] - min_diff
25206 : *
25207 : */
25208 17752 : __pyx_v_tp = (__pyx_v_tp + 1);
25209 : }
25210 :
25211 : /* "scipy/sparse/csgraph/_matching.pyx":767
25212 : * while kk[tp] != j0:
25213 : * tp += 1
25214 : * h = cc[tp] - v[j0] - min_diff # <<<<<<<<<<<<<<
25215 : *
25216 : * for t in range(first[i], first[i + 1]):
25217 : */
25218 6703 : __pyx_t_4 = __pyx_v_tp;
25219 6703 : __pyx_t_6 = __pyx_v_j0;
25220 6703 : __pyx_v_h = (((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_cc.data + __pyx_t_4 * __pyx_v_cc.strides[0]) ))) - (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_6 * __pyx_v_v.strides[0]) )))) - __pyx_v_min_diff);
25221 :
25222 : /* "scipy/sparse/csgraph/_matching.pyx":769
25223 : * h = cc[tp] - v[j0] - min_diff
25224 : *
25225 : * for t in range(first[i], first[i + 1]): # <<<<<<<<<<<<<<
25226 : * j = kk[t]
25227 : * if ok[j] == 0:
25228 : */
25229 6703 : __pyx_t_6 = (__pyx_v_i + 1);
25230 6703 : __pyx_t_1 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_first.data + __pyx_t_6 * __pyx_v_first.strides[0]) )));
25231 6703 : __pyx_t_6 = __pyx_v_i;
25232 6703 : __pyx_t_2 = __pyx_t_1;
25233 47538 : for (__pyx_t_3 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_first.data + __pyx_t_6 * __pyx_v_first.strides[0]) ))); __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
25234 40980 : __pyx_v_t = __pyx_t_3;
25235 :
25236 : /* "scipy/sparse/csgraph/_matching.pyx":770
25237 : *
25238 : * for t in range(first[i], first[i + 1]):
25239 : * j = kk[t] # <<<<<<<<<<<<<<
25240 : * if ok[j] == 0:
25241 : * vj = cc[t] - v[j] - h
25242 : */
25243 40980 : __pyx_t_4 = __pyx_v_t;
25244 40980 : __pyx_v_j = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_kk.data + __pyx_t_4 * __pyx_v_kk.strides[0]) )));
25245 :
25246 : /* "scipy/sparse/csgraph/_matching.pyx":771
25247 : * for t in range(first[i], first[i + 1]):
25248 : * j = kk[t]
25249 : * if ok[j] == 0: # <<<<<<<<<<<<<<
25250 : * vj = cc[t] - v[j] - h
25251 : * if vj < d[j]:
25252 : */
25253 40980 : __pyx_t_4 = __pyx_v_j;
25254 40980 : __pyx_t_7 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t *) ( /* dim=0 */ (__pyx_v_ok.data + __pyx_t_4 * __pyx_v_ok.strides[0]) ))) == 0);
25255 40980 : if (__pyx_t_7) {
25256 :
25257 : /* "scipy/sparse/csgraph/_matching.pyx":772
25258 : * j = kk[t]
25259 : * if ok[j] == 0:
25260 : * vj = cc[t] - v[j] - h # <<<<<<<<<<<<<<
25261 : * if vj < d[j]:
25262 : * d[j] = vj
25263 : */
25264 25649 : __pyx_t_4 = __pyx_v_t;
25265 25649 : __pyx_t_5 = __pyx_v_j;
25266 25649 : __pyx_v_vj = (((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_cc.data + __pyx_t_4 * __pyx_v_cc.strides[0]) ))) - (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_5 * __pyx_v_v.strides[0]) )))) - __pyx_v_h);
25267 :
25268 : /* "scipy/sparse/csgraph/_matching.pyx":773
25269 : * if ok[j] == 0:
25270 : * vj = cc[t] - v[j] - h
25271 : * if vj < d[j]: # <<<<<<<<<<<<<<
25272 : * d[j] = vj
25273 : * lab[j] = i
25274 : */
25275 25649 : __pyx_t_5 = __pyx_v_j;
25276 25649 : __pyx_t_7 = (__pyx_v_vj < (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_d.data + __pyx_t_5 * __pyx_v_d.strides[0]) ))));
25277 25649 : if (__pyx_t_7) {
25278 :
25279 : /* "scipy/sparse/csgraph/_matching.pyx":774
25280 : * vj = cc[t] - v[j] - h
25281 : * if vj < d[j]:
25282 : * d[j] = vj # <<<<<<<<<<<<<<
25283 : * lab[j] = i
25284 : * if vj == min_diff:
25285 : */
25286 18506 : __pyx_t_5 = __pyx_v_j;
25287 18506 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_d.data + __pyx_t_5 * __pyx_v_d.strides[0]) )) = __pyx_v_vj;
25288 :
25289 : /* "scipy/sparse/csgraph/_matching.pyx":775
25290 : * if vj < d[j]:
25291 : * d[j] = vj
25292 : * lab[j] = i # <<<<<<<<<<<<<<
25293 : * if vj == min_diff:
25294 : * if y[j] == -1:
25295 : */
25296 18506 : __pyx_t_5 = __pyx_v_j;
25297 18506 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_lab.data + __pyx_t_5 * __pyx_v_lab.strides[0]) )) = __pyx_v_i;
25298 :
25299 : /* "scipy/sparse/csgraph/_matching.pyx":776
25300 : * d[j] = vj
25301 : * lab[j] = i
25302 : * if vj == min_diff: # <<<<<<<<<<<<<<
25303 : * if y[j] == -1:
25304 : * _lapjvsp_update_dual(nc, d, v, todo,
25305 : */
25306 18506 : __pyx_t_7 = (__pyx_v_vj == __pyx_v_min_diff);
25307 18506 : if (__pyx_t_7) {
25308 :
25309 : /* "scipy/sparse/csgraph/_matching.pyx":777
25310 : * lab[j] = i
25311 : * if vj == min_diff:
25312 : * if y[j] == -1: # <<<<<<<<<<<<<<
25313 : * _lapjvsp_update_dual(nc, d, v, todo,
25314 : * last, min_diff)
25315 : */
25316 4574 : __pyx_t_5 = __pyx_v_j;
25317 4574 : __pyx_t_7 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_5 * __pyx_v_y.strides[0]) ))) == -1L);
25318 4574 : if (__pyx_t_7) {
25319 :
25320 : /* "scipy/sparse/csgraph/_matching.pyx":778
25321 : * if vj == min_diff:
25322 : * if y[j] == -1:
25323 : * _lapjvsp_update_dual(nc, d, v, todo, # <<<<<<<<<<<<<<
25324 : * last, min_diff)
25325 : * _lapjvsp_update_assignments(lab, y, x, j, i0)
25326 : */
25327 145 : __pyx_t_10 = __pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp_update_dual(__pyx_v_nc, __pyx_v_d, __pyx_v_v, __pyx_v_todo, __pyx_v_last, __pyx_v_min_diff); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 778, __pyx_L1_error)
25328 145 : __Pyx_GOTREF(__pyx_t_10);
25329 290 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25330 :
25331 : /* "scipy/sparse/csgraph/_matching.pyx":780
25332 : * _lapjvsp_update_dual(nc, d, v, todo,
25333 : * last, min_diff)
25334 : * _lapjvsp_update_assignments(lab, y, x, j, i0) # <<<<<<<<<<<<<<
25335 : * return td1
25336 : * td1 += 1
25337 : */
25338 290 : __pyx_t_10 = __pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp_update_assignments(__pyx_v_lab, __pyx_v_y, __pyx_v_x, __pyx_v_j, __pyx_v_i0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 780, __pyx_L1_error)
25339 145 : __Pyx_GOTREF(__pyx_t_10);
25340 290 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25341 :
25342 : /* "scipy/sparse/csgraph/_matching.pyx":781
25343 : * last, min_diff)
25344 : * _lapjvsp_update_assignments(lab, y, x, j, i0)
25345 : * return td1 # <<<<<<<<<<<<<<
25346 : * td1 += 1
25347 : * todo[td1] = j
25348 : */
25349 145 : __pyx_r = __pyx_v_td1;
25350 145 : goto __pyx_L0;
25351 :
25352 : /* "scipy/sparse/csgraph/_matching.pyx":777
25353 : * lab[j] = i
25354 : * if vj == min_diff:
25355 : * if y[j] == -1: # <<<<<<<<<<<<<<
25356 : * _lapjvsp_update_dual(nc, d, v, todo,
25357 : * last, min_diff)
25358 : */
25359 : }
25360 :
25361 : /* "scipy/sparse/csgraph/_matching.pyx":782
25362 : * _lapjvsp_update_assignments(lab, y, x, j, i0)
25363 : * return td1
25364 : * td1 += 1 # <<<<<<<<<<<<<<
25365 : * todo[td1] = j
25366 : * ok[j] = 1
25367 : */
25368 4429 : __pyx_v_td1 = (__pyx_v_td1 + 1);
25369 :
25370 : /* "scipy/sparse/csgraph/_matching.pyx":783
25371 : * return td1
25372 : * td1 += 1
25373 : * todo[td1] = j # <<<<<<<<<<<<<<
25374 : * ok[j] = 1
25375 : *
25376 : */
25377 4429 : __pyx_t_5 = __pyx_v_td1;
25378 4429 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_todo.data + __pyx_t_5 * __pyx_v_todo.strides[0]) )) = __pyx_v_j;
25379 :
25380 : /* "scipy/sparse/csgraph/_matching.pyx":784
25381 : * td1 += 1
25382 : * todo[td1] = j
25383 : * ok[j] = 1 # <<<<<<<<<<<<<<
25384 : *
25385 : * if td1 == -1:
25386 : */
25387 4429 : __pyx_t_5 = __pyx_v_j;
25388 4429 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t *) ( /* dim=0 */ (__pyx_v_ok.data + __pyx_t_5 * __pyx_v_ok.strides[0]) )) = 1;
25389 :
25390 : /* "scipy/sparse/csgraph/_matching.pyx":776
25391 : * d[j] = vj
25392 : * lab[j] = i
25393 : * if vj == min_diff: # <<<<<<<<<<<<<<
25394 : * if y[j] == -1:
25395 : * _lapjvsp_update_dual(nc, d, v, todo,
25396 : */
25397 : }
25398 :
25399 : /* "scipy/sparse/csgraph/_matching.pyx":773
25400 : * if ok[j] == 0:
25401 : * vj = cc[t] - v[j] - h
25402 : * if vj < d[j]: # <<<<<<<<<<<<<<
25403 : * d[j] = vj
25404 : * lab[j] = i
25405 : */
25406 : }
25407 :
25408 : /* "scipy/sparse/csgraph/_matching.pyx":771
25409 : * for t in range(first[i], first[i + 1]):
25410 : * j = kk[t]
25411 : * if ok[j] == 0: # <<<<<<<<<<<<<<
25412 : * vj = cc[t] - v[j] - h
25413 : * if vj < d[j]:
25414 : */
25415 : }
25416 : }
25417 :
25418 : /* "scipy/sparse/csgraph/_matching.pyx":786
25419 : * ok[j] = 1
25420 : *
25421 : * if td1 == -1: # <<<<<<<<<<<<<<
25422 : * # The original Pascal code uses finite numbers instead of INFINITY
25423 : * # so we need to adjust slightly here.
25424 : */
25425 6558 : __pyx_t_7 = (__pyx_v_td1 == -1L);
25426 6558 : if (__pyx_t_7) {
25427 :
25428 : /* "scipy/sparse/csgraph/_matching.pyx":789
25429 : * # The original Pascal code uses finite numbers instead of INFINITY
25430 : * # so we need to adjust slightly here.
25431 : * min_diff = INFINITY # <<<<<<<<<<<<<<
25432 : * last = td2 + 1
25433 : *
25434 : */
25435 : __pyx_v_min_diff = INFINITY;
25436 :
25437 : /* "scipy/sparse/csgraph/_matching.pyx":790
25438 : * # so we need to adjust slightly here.
25439 : * min_diff = INFINITY
25440 : * last = td2 + 1 # <<<<<<<<<<<<<<
25441 : *
25442 : * for jp in range(nc):
25443 : */
25444 131098 : __pyx_v_last = (__pyx_v_td2 + 1);
25445 :
25446 : /* "scipy/sparse/csgraph/_matching.pyx":792
25447 : * last = td2 + 1
25448 : *
25449 : * for jp in range(nc): # <<<<<<<<<<<<<<
25450 : * if d[jp] != INFINITY and d[jp] <= min_diff and ok[jp] == 0:
25451 : * if d[jp] < min_diff:
25452 : */
25453 131098 : __pyx_t_1 = __pyx_v_nc;
25454 131098 : __pyx_t_2 = __pyx_t_1;
25455 131098 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
25456 129800 : __pyx_v_jp = __pyx_t_3;
25457 :
25458 : /* "scipy/sparse/csgraph/_matching.pyx":793
25459 : *
25460 : * for jp in range(nc):
25461 : * if d[jp] != INFINITY and d[jp] <= min_diff and ok[jp] == 0: # <<<<<<<<<<<<<<
25462 : * if d[jp] < min_diff:
25463 : * td1 = -1
25464 : */
25465 129800 : __pyx_t_6 = __pyx_v_jp;
25466 129800 : __pyx_t_11 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_d.data + __pyx_t_6 * __pyx_v_d.strides[0]) ))) != INFINITY);
25467 129800 : if (__pyx_t_11) {
25468 85911 : } else {
25469 43889 : __pyx_t_7 = __pyx_t_11;
25470 43889 : goto __pyx_L27_bool_binop_done;
25471 : }
25472 85911 : __pyx_t_6 = __pyx_v_jp;
25473 85911 : __pyx_t_11 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_d.data + __pyx_t_6 * __pyx_v_d.strides[0]) ))) <= __pyx_v_min_diff);
25474 85911 : if (__pyx_t_11) {
25475 46056 : } else {
25476 39855 : __pyx_t_7 = __pyx_t_11;
25477 39855 : goto __pyx_L27_bool_binop_done;
25478 : }
25479 46056 : __pyx_t_6 = __pyx_v_jp;
25480 46056 : __pyx_t_11 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t *) ( /* dim=0 */ (__pyx_v_ok.data + __pyx_t_6 * __pyx_v_ok.strides[0]) ))) == 0);
25481 46056 : __pyx_t_7 = __pyx_t_11;
25482 129800 : __pyx_L27_bool_binop_done:;
25483 129800 : if (__pyx_t_7) {
25484 :
25485 : /* "scipy/sparse/csgraph/_matching.pyx":794
25486 : * for jp in range(nc):
25487 : * if d[jp] != INFINITY and d[jp] <= min_diff and ok[jp] == 0:
25488 : * if d[jp] < min_diff: # <<<<<<<<<<<<<<
25489 : * td1 = -1
25490 : * min_diff = d[jp]
25491 : */
25492 6130 : __pyx_t_6 = __pyx_v_jp;
25493 6130 : __pyx_t_7 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_d.data + __pyx_t_6 * __pyx_v_d.strides[0]) ))) < __pyx_v_min_diff);
25494 6130 : if (__pyx_t_7) {
25495 :
25496 : /* "scipy/sparse/csgraph/_matching.pyx":795
25497 : * if d[jp] != INFINITY and d[jp] <= min_diff and ok[jp] == 0:
25498 : * if d[jp] < min_diff:
25499 : * td1 = -1 # <<<<<<<<<<<<<<
25500 : * min_diff = d[jp]
25501 : * td1 += 1
25502 : */
25503 4857 : __pyx_v_td1 = -1;
25504 :
25505 : /* "scipy/sparse/csgraph/_matching.pyx":796
25506 : * if d[jp] < min_diff:
25507 : * td1 = -1
25508 : * min_diff = d[jp] # <<<<<<<<<<<<<<
25509 : * td1 += 1
25510 : * todo[td1] = jp
25511 : */
25512 4857 : __pyx_t_6 = __pyx_v_jp;
25513 4857 : __pyx_v_min_diff = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_d.data + __pyx_t_6 * __pyx_v_d.strides[0]) )));
25514 :
25515 : /* "scipy/sparse/csgraph/_matching.pyx":794
25516 : * for jp in range(nc):
25517 : * if d[jp] != INFINITY and d[jp] <= min_diff and ok[jp] == 0:
25518 : * if d[jp] < min_diff: # <<<<<<<<<<<<<<
25519 : * td1 = -1
25520 : * min_diff = d[jp]
25521 : */
25522 : }
25523 :
25524 : /* "scipy/sparse/csgraph/_matching.pyx":797
25525 : * td1 = -1
25526 : * min_diff = d[jp]
25527 : * td1 += 1 # <<<<<<<<<<<<<<
25528 : * todo[td1] = jp
25529 : *
25530 : */
25531 6130 : __pyx_v_td1 = (__pyx_v_td1 + 1);
25532 :
25533 : /* "scipy/sparse/csgraph/_matching.pyx":798
25534 : * min_diff = d[jp]
25535 : * td1 += 1
25536 : * todo[td1] = jp # <<<<<<<<<<<<<<
25537 : *
25538 : * for hp in range(td1 + 1):
25539 : */
25540 6130 : __pyx_t_6 = __pyx_v_td1;
25541 6130 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_todo.data + __pyx_t_6 * __pyx_v_todo.strides[0]) )) = __pyx_v_jp;
25542 :
25543 : /* "scipy/sparse/csgraph/_matching.pyx":793
25544 : *
25545 : * for jp in range(nc):
25546 : * if d[jp] != INFINITY and d[jp] <= min_diff and ok[jp] == 0: # <<<<<<<<<<<<<<
25547 : * if d[jp] < min_diff:
25548 : * td1 = -1
25549 : */
25550 : }
25551 : }
25552 :
25553 : /* "scipy/sparse/csgraph/_matching.pyx":800
25554 : * todo[td1] = jp
25555 : *
25556 : * for hp in range(td1 + 1): # <<<<<<<<<<<<<<
25557 : * j = todo[hp]
25558 : * if y[j] == -1:
25559 : */
25560 1298 : __pyx_t_8 = (__pyx_v_td1 + 1);
25561 1298 : __pyx_t_9 = __pyx_t_8;
25562 3407 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_9; __pyx_t_1+=1) {
25563 2151 : __pyx_v_hp = __pyx_t_1;
25564 :
25565 : /* "scipy/sparse/csgraph/_matching.pyx":801
25566 : *
25567 : * for hp in range(td1 + 1):
25568 : * j = todo[hp] # <<<<<<<<<<<<<<
25569 : * if y[j] == -1:
25570 : * _lapjvsp_update_dual(nc, d, v, todo, last, min_diff)
25571 : */
25572 2151 : __pyx_t_6 = __pyx_v_hp;
25573 2151 : __pyx_v_j = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_todo.data + __pyx_t_6 * __pyx_v_todo.strides[0]) )));
25574 :
25575 : /* "scipy/sparse/csgraph/_matching.pyx":802
25576 : * for hp in range(td1 + 1):
25577 : * j = todo[hp]
25578 : * if y[j] == -1: # <<<<<<<<<<<<<<
25579 : * _lapjvsp_update_dual(nc, d, v, todo, last, min_diff)
25580 : * _lapjvsp_update_assignments(lab, y, x, j, i0)
25581 : */
25582 2151 : __pyx_t_6 = __pyx_v_j;
25583 2151 : __pyx_t_7 = ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_6 * __pyx_v_y.strides[0]) ))) == -1L);
25584 2151 : if (__pyx_t_7) {
25585 :
25586 : /* "scipy/sparse/csgraph/_matching.pyx":803
25587 : * j = todo[hp]
25588 : * if y[j] == -1:
25589 : * _lapjvsp_update_dual(nc, d, v, todo, last, min_diff) # <<<<<<<<<<<<<<
25590 : * _lapjvsp_update_assignments(lab, y, x, j, i0)
25591 : * return td1
25592 : */
25593 42 : __pyx_t_10 = __pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp_update_dual(__pyx_v_nc, __pyx_v_d, __pyx_v_v, __pyx_v_todo, __pyx_v_last, __pyx_v_min_diff); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 803, __pyx_L1_error)
25594 42 : __Pyx_GOTREF(__pyx_t_10);
25595 84 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25596 :
25597 : /* "scipy/sparse/csgraph/_matching.pyx":804
25598 : * if y[j] == -1:
25599 : * _lapjvsp_update_dual(nc, d, v, todo, last, min_diff)
25600 : * _lapjvsp_update_assignments(lab, y, x, j, i0) # <<<<<<<<<<<<<<
25601 : * return td1
25602 : * ok[j] = 1
25603 : */
25604 84 : __pyx_t_10 = __pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp_update_assignments(__pyx_v_lab, __pyx_v_y, __pyx_v_x, __pyx_v_j, __pyx_v_i0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 804, __pyx_L1_error)
25605 42 : __Pyx_GOTREF(__pyx_t_10);
25606 84 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25607 :
25608 : /* "scipy/sparse/csgraph/_matching.pyx":805
25609 : * _lapjvsp_update_dual(nc, d, v, todo, last, min_diff)
25610 : * _lapjvsp_update_assignments(lab, y, x, j, i0)
25611 : * return td1 # <<<<<<<<<<<<<<
25612 : * ok[j] = 1
25613 : *
25614 : */
25615 42 : __pyx_r = __pyx_v_td1;
25616 42 : goto __pyx_L0;
25617 :
25618 : /* "scipy/sparse/csgraph/_matching.pyx":802
25619 : * for hp in range(td1 + 1):
25620 : * j = todo[hp]
25621 : * if y[j] == -1: # <<<<<<<<<<<<<<
25622 : * _lapjvsp_update_dual(nc, d, v, todo, last, min_diff)
25623 : * _lapjvsp_update_assignments(lab, y, x, j, i0)
25624 : */
25625 : }
25626 :
25627 : /* "scipy/sparse/csgraph/_matching.pyx":806
25628 : * _lapjvsp_update_assignments(lab, y, x, j, i0)
25629 : * return td1
25630 : * ok[j] = 1 # <<<<<<<<<<<<<<
25631 : *
25632 : *
25633 : */
25634 2109 : __pyx_t_6 = __pyx_v_j;
25635 2109 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t *) ( /* dim=0 */ (__pyx_v_ok.data + __pyx_t_6 * __pyx_v_ok.strides[0]) )) = 1;
25636 : }
25637 :
25638 : /* "scipy/sparse/csgraph/_matching.pyx":786
25639 : * ok[j] = 1
25640 : *
25641 : * if td1 == -1: # <<<<<<<<<<<<<<
25642 : * # The original Pascal code uses finite numbers instead of INFINITY
25643 : * # so we need to adjust slightly here.
25644 : */
25645 : }
25646 : }
25647 :
25648 : /* "scipy/sparse/csgraph/_matching.pyx":717
25649 : * @cython.boundscheck(False)
25650 : * @cython.wraparound(False)
25651 : * cdef ITYPE_t _lapjvsp_single_l(ITYPE_t l, ITYPE_t nc, DTYPE_t[:] d, # <<<<<<<<<<<<<<
25652 : * BTYPE_t[:] ok, ITYPE_t[:] free,
25653 : * ITYPE_t[:] first, ITYPE_t[:] kk,
25654 : */
25655 :
25656 : /* function exit code */
25657 : __pyx_r = 0;
25658 : goto __pyx_L0;
25659 0 : __pyx_L1_error:;
25660 0 : __Pyx_XDECREF(__pyx_t_10);
25661 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._matching._lapjvsp_single_l", __pyx_clineno, __pyx_lineno, __pyx_filename);
25662 0 : __pyx_r = -2;
25663 190 : __pyx_L0:;
25664 190 : __Pyx_RefNannyFinishContext();
25665 190 : return __pyx_r;
25666 : }
25667 :
25668 : /* "scipy/sparse/csgraph/_matching.pyx":811
25669 : * @cython.boundscheck(False)
25670 : * @cython.wraparound(False)
25671 : * cdef _lapjvsp_update_dual(ITYPE_t nc, DTYPE_t[:] d, DTYPE_t[:] v, # <<<<<<<<<<<<<<
25672 : * ITYPE_t[:] todo, ITYPE_t last, DTYPE_t min_diff):
25673 : * cdef ITYPE_t j0
25674 : */
25675 :
25676 : static PyObject *__pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp_update_dual(__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_nc, __Pyx_memviewslice __pyx_v_d, __Pyx_memviewslice __pyx_v_v, __Pyx_memviewslice __pyx_v_todo, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_last, __pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t __pyx_v_min_diff) {
25677 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_j0;
25678 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_k;
25679 6436 : PyObject *__pyx_r = NULL;
25680 : __Pyx_RefNannyDeclarations
25681 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_1;
25682 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_2;
25683 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_t_3;
25684 : Py_ssize_t __pyx_t_4;
25685 : Py_ssize_t __pyx_t_5;
25686 : __Pyx_RefNannySetupContext("_lapjvsp_update_dual", 1);
25687 :
25688 : /* "scipy/sparse/csgraph/_matching.pyx":814
25689 : * ITYPE_t[:] todo, ITYPE_t last, DTYPE_t min_diff):
25690 : * cdef ITYPE_t j0
25691 : * for k in range(last, nc): # <<<<<<<<<<<<<<
25692 : * j0 = todo[k]
25693 : * v[j0] += d[j0] - min_diff
25694 : */
25695 : __pyx_t_1 = __pyx_v_nc;
25696 : __pyx_t_2 = __pyx_t_1;
25697 6436 : for (__pyx_t_3 = __pyx_v_last; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
25698 6249 : __pyx_v_k = __pyx_t_3;
25699 :
25700 : /* "scipy/sparse/csgraph/_matching.pyx":815
25701 : * cdef ITYPE_t j0
25702 : * for k in range(last, nc):
25703 : * j0 = todo[k] # <<<<<<<<<<<<<<
25704 : * v[j0] += d[j0] - min_diff
25705 : *
25706 : */
25707 6249 : __pyx_t_4 = __pyx_v_k;
25708 6249 : __pyx_v_j0 = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_todo.data + __pyx_t_4 * __pyx_v_todo.strides[0]) )));
25709 :
25710 : /* "scipy/sparse/csgraph/_matching.pyx":816
25711 : * for k in range(last, nc):
25712 : * j0 = todo[k]
25713 : * v[j0] += d[j0] - min_diff # <<<<<<<<<<<<<<
25714 : *
25715 : *
25716 : */
25717 6249 : __pyx_t_4 = __pyx_v_j0;
25718 6249 : __pyx_t_5 = __pyx_v_j0;
25719 6249 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_5 * __pyx_v_v.strides[0]) )) += ((*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t *) ( /* dim=0 */ (__pyx_v_d.data + __pyx_t_4 * __pyx_v_d.strides[0]) ))) - __pyx_v_min_diff);
25720 : }
25721 :
25722 : /* "scipy/sparse/csgraph/_matching.pyx":811
25723 : * @cython.boundscheck(False)
25724 : * @cython.wraparound(False)
25725 : * cdef _lapjvsp_update_dual(ITYPE_t nc, DTYPE_t[:] d, DTYPE_t[:] v, # <<<<<<<<<<<<<<
25726 : * ITYPE_t[:] todo, ITYPE_t last, DTYPE_t min_diff):
25727 : * cdef ITYPE_t j0
25728 : */
25729 :
25730 : /* function exit code */
25731 187 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25732 187 : __Pyx_XGIVEREF(__pyx_r);
25733 187 : __Pyx_RefNannyFinishContext();
25734 187 : return __pyx_r;
25735 : }
25736 :
25737 : /* "scipy/sparse/csgraph/_matching.pyx":821
25738 : * @cython.boundscheck(False)
25739 : * @cython.wraparound(False)
25740 : * cdef _lapjvsp_update_assignments(ITYPE_t[:] lab, ITYPE_t[:] y, ITYPE_t[:] x, # <<<<<<<<<<<<<<
25741 : * ITYPE_t j, ITYPE_t i0):
25742 : * cdef ITYPE_t i, k
25743 : */
25744 :
25745 190 : static PyObject *__pyx_f_5scipy_6sparse_7csgraph_9_matching__lapjvsp_update_assignments(__Pyx_memviewslice __pyx_v_lab, __Pyx_memviewslice __pyx_v_y, __Pyx_memviewslice __pyx_v_x, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_j, __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_i0) {
25746 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_i;
25747 190 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t __pyx_v_k;
25748 190 : PyObject *__pyx_r = NULL;
25749 : __Pyx_RefNannyDeclarations
25750 1435 : Py_ssize_t __pyx_t_1;
25751 1435 : int __pyx_t_2;
25752 1435 : __Pyx_RefNannySetupContext("_lapjvsp_update_assignments", 1);
25753 :
25754 : /* "scipy/sparse/csgraph/_matching.pyx":824
25755 : * ITYPE_t j, ITYPE_t i0):
25756 : * cdef ITYPE_t i, k
25757 : * while True: # <<<<<<<<<<<<<<
25758 : * i = lab[j]
25759 : * y[j] = i
25760 : */
25761 1435 : while (1) {
25762 :
25763 : /* "scipy/sparse/csgraph/_matching.pyx":825
25764 : * cdef ITYPE_t i, k
25765 : * while True:
25766 : * i = lab[j] # <<<<<<<<<<<<<<
25767 : * y[j] = i
25768 : * k = j
25769 : */
25770 1435 : __pyx_t_1 = __pyx_v_j;
25771 1435 : __pyx_v_i = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_lab.data + __pyx_t_1 * __pyx_v_lab.strides[0]) )));
25772 :
25773 : /* "scipy/sparse/csgraph/_matching.pyx":826
25774 : * while True:
25775 : * i = lab[j]
25776 : * y[j] = i # <<<<<<<<<<<<<<
25777 : * k = j
25778 : * j = x[i]
25779 : */
25780 1435 : __pyx_t_1 = __pyx_v_j;
25781 1435 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_1 * __pyx_v_y.strides[0]) )) = __pyx_v_i;
25782 :
25783 : /* "scipy/sparse/csgraph/_matching.pyx":827
25784 : * i = lab[j]
25785 : * y[j] = i
25786 : * k = j # <<<<<<<<<<<<<<
25787 : * j = x[i]
25788 : * x[i] = k
25789 : */
25790 1435 : __pyx_v_k = __pyx_v_j;
25791 :
25792 : /* "scipy/sparse/csgraph/_matching.pyx":828
25793 : * y[j] = i
25794 : * k = j
25795 : * j = x[i] # <<<<<<<<<<<<<<
25796 : * x[i] = k
25797 : * if i == i0:
25798 : */
25799 1435 : __pyx_t_1 = __pyx_v_i;
25800 1435 : __pyx_v_j = (*((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_1 * __pyx_v_x.strides[0]) )));
25801 :
25802 : /* "scipy/sparse/csgraph/_matching.pyx":829
25803 : * k = j
25804 : * j = x[i]
25805 : * x[i] = k # <<<<<<<<<<<<<<
25806 : * if i == i0:
25807 : * return
25808 : */
25809 1435 : __pyx_t_1 = __pyx_v_i;
25810 1435 : *((__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_1 * __pyx_v_x.strides[0]) )) = __pyx_v_k;
25811 :
25812 : /* "scipy/sparse/csgraph/_matching.pyx":830
25813 : * j = x[i]
25814 : * x[i] = k
25815 : * if i == i0: # <<<<<<<<<<<<<<
25816 : * return
25817 : */
25818 1435 : __pyx_t_2 = (__pyx_v_i == __pyx_v_i0);
25819 1435 : if (__pyx_t_2) {
25820 :
25821 : /* "scipy/sparse/csgraph/_matching.pyx":831
25822 : * x[i] = k
25823 : * if i == i0:
25824 : * return # <<<<<<<<<<<<<<
25825 : */
25826 190 : __Pyx_XDECREF(__pyx_r);
25827 190 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25828 190 : goto __pyx_L0;
25829 :
25830 : /* "scipy/sparse/csgraph/_matching.pyx":830
25831 : * j = x[i]
25832 : * x[i] = k
25833 : * if i == i0: # <<<<<<<<<<<<<<
25834 : * return
25835 : */
25836 : }
25837 : }
25838 :
25839 : /* "scipy/sparse/csgraph/_matching.pyx":821
25840 : * @cython.boundscheck(False)
25841 : * @cython.wraparound(False)
25842 : * cdef _lapjvsp_update_assignments(ITYPE_t[:] lab, ITYPE_t[:] y, ITYPE_t[:] x, # <<<<<<<<<<<<<<
25843 : * ITYPE_t j, ITYPE_t i0):
25844 : * cdef ITYPE_t i, k
25845 : */
25846 :
25847 : /* function exit code */
25848 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25849 190 : __pyx_L0:;
25850 190 : __Pyx_XGIVEREF(__pyx_r);
25851 190 : __Pyx_RefNannyFinishContext();
25852 190 : return __pyx_r;
25853 : }
25854 : static struct __pyx_vtabstruct_array __pyx_vtable_array;
25855 :
25856 0 : static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
25857 0 : struct __pyx_array_obj *p;
25858 0 : PyObject *o;
25859 : #if CYTHON_COMPILING_IN_LIMITED_API
25860 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
25861 : o = alloc_func(t, 0);
25862 : #else
25863 0 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
25864 0 : o = (*t->tp_alloc)(t, 0);
25865 : } else {
25866 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25867 : }
25868 0 : if (unlikely(!o)) return 0;
25869 : #endif
25870 0 : p = ((struct __pyx_array_obj *)o);
25871 0 : p->__pyx_vtab = __pyx_vtabptr_array;
25872 0 : p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
25873 0 : p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
25874 0 : if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
25875 : return o;
25876 0 : bad:
25877 0 : Py_DECREF(o); o = 0;
25878 : return NULL;
25879 : }
25880 :
25881 0 : static void __pyx_tp_dealloc_array(PyObject *o) {
25882 0 : struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
25883 : #if CYTHON_USE_TP_FINALIZE
25884 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25885 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
25886 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
25887 : }
25888 : }
25889 : #endif
25890 : {
25891 0 : PyObject *etype, *eval, *etb;
25892 0 : PyErr_Fetch(&etype, &eval, &etb);
25893 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25894 0 : __pyx_array___dealloc__(o);
25895 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25896 0 : PyErr_Restore(etype, eval, etb);
25897 : }
25898 0 : Py_CLEAR(p->mode);
25899 0 : Py_CLEAR(p->_format);
25900 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
25901 0 : (*Py_TYPE(o)->tp_free)(o);
25902 : #else
25903 : {
25904 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
25905 : if (tp_free) tp_free(o);
25906 : }
25907 : #endif
25908 : }
25909 0 : static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
25910 0 : PyObject *r;
25911 0 : PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
25912 0 : r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
25913 0 : Py_DECREF(x);
25914 : return r;
25915 : }
25916 :
25917 0 : static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
25918 0 : if (v) {
25919 0 : return __pyx_array___setitem__(o, i, v);
25920 : }
25921 : else {
25922 0 : __Pyx_TypeName o_type_name;
25923 0 : o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
25924 0 : PyErr_Format(PyExc_NotImplementedError,
25925 : "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
25926 0 : __Pyx_DECREF_TypeName(o_type_name);
25927 0 : return -1;
25928 : }
25929 : }
25930 :
25931 0 : static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
25932 0 : PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
25933 0 : if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25934 0 : PyErr_Clear();
25935 0 : v = __pyx_array___getattr__(o, n);
25936 : }
25937 0 : return v;
25938 : }
25939 :
25940 0 : static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
25941 0 : return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
25942 : }
25943 :
25944 : static PyMethodDef __pyx_methods_array[] = {
25945 : {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
25946 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25947 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25948 : {0, 0, 0, 0}
25949 : };
25950 :
25951 : static struct PyGetSetDef __pyx_getsets_array[] = {
25952 : {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
25953 : {0, 0, 0, 0, 0}
25954 : };
25955 : #if CYTHON_USE_TYPE_SPECS
25956 : #if !CYTHON_COMPILING_IN_LIMITED_API
25957 :
25958 : static PyBufferProcs __pyx_tp_as_buffer_array = {
25959 : #if PY_MAJOR_VERSION < 3
25960 : 0, /*bf_getreadbuffer*/
25961 : #endif
25962 : #if PY_MAJOR_VERSION < 3
25963 : 0, /*bf_getwritebuffer*/
25964 : #endif
25965 : #if PY_MAJOR_VERSION < 3
25966 : 0, /*bf_getsegcount*/
25967 : #endif
25968 : #if PY_MAJOR_VERSION < 3
25969 : 0, /*bf_getcharbuffer*/
25970 : #endif
25971 : __pyx_array_getbuffer, /*bf_getbuffer*/
25972 : 0, /*bf_releasebuffer*/
25973 : };
25974 : #endif
25975 : static PyType_Slot __pyx_type___pyx_array_slots[] = {
25976 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
25977 : {Py_sq_length, (void *)__pyx_array___len__},
25978 : {Py_sq_item, (void *)__pyx_sq_item_array},
25979 : {Py_mp_length, (void *)__pyx_array___len__},
25980 : {Py_mp_subscript, (void *)__pyx_array___getitem__},
25981 : {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
25982 : {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
25983 : #if defined(Py_bf_getbuffer)
25984 : {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
25985 : #endif
25986 : {Py_tp_methods, (void *)__pyx_methods_array},
25987 : {Py_tp_getset, (void *)__pyx_getsets_array},
25988 : {Py_tp_new, (void *)__pyx_tp_new_array},
25989 : {0, 0},
25990 : };
25991 : static PyType_Spec __pyx_type___pyx_array_spec = {
25992 : "scipy.sparse.csgraph._matching.array",
25993 : sizeof(struct __pyx_array_obj),
25994 : 0,
25995 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
25996 : __pyx_type___pyx_array_slots,
25997 : };
25998 : #else
25999 :
26000 : static PySequenceMethods __pyx_tp_as_sequence_array = {
26001 : __pyx_array___len__, /*sq_length*/
26002 : 0, /*sq_concat*/
26003 : 0, /*sq_repeat*/
26004 : __pyx_sq_item_array, /*sq_item*/
26005 : 0, /*sq_slice*/
26006 : 0, /*sq_ass_item*/
26007 : 0, /*sq_ass_slice*/
26008 : 0, /*sq_contains*/
26009 : 0, /*sq_inplace_concat*/
26010 : 0, /*sq_inplace_repeat*/
26011 : };
26012 :
26013 : static PyMappingMethods __pyx_tp_as_mapping_array = {
26014 : __pyx_array___len__, /*mp_length*/
26015 : __pyx_array___getitem__, /*mp_subscript*/
26016 : __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
26017 : };
26018 :
26019 : static PyBufferProcs __pyx_tp_as_buffer_array = {
26020 : #if PY_MAJOR_VERSION < 3
26021 : 0, /*bf_getreadbuffer*/
26022 : #endif
26023 : #if PY_MAJOR_VERSION < 3
26024 : 0, /*bf_getwritebuffer*/
26025 : #endif
26026 : #if PY_MAJOR_VERSION < 3
26027 : 0, /*bf_getsegcount*/
26028 : #endif
26029 : #if PY_MAJOR_VERSION < 3
26030 : 0, /*bf_getcharbuffer*/
26031 : #endif
26032 : __pyx_array_getbuffer, /*bf_getbuffer*/
26033 : 0, /*bf_releasebuffer*/
26034 : };
26035 :
26036 : static PyTypeObject __pyx_type___pyx_array = {
26037 : PyVarObject_HEAD_INIT(0, 0)
26038 : "scipy.sparse.csgraph._matching.""array", /*tp_name*/
26039 : sizeof(struct __pyx_array_obj), /*tp_basicsize*/
26040 : 0, /*tp_itemsize*/
26041 : __pyx_tp_dealloc_array, /*tp_dealloc*/
26042 : #if PY_VERSION_HEX < 0x030800b4
26043 : 0, /*tp_print*/
26044 : #endif
26045 : #if PY_VERSION_HEX >= 0x030800b4
26046 : 0, /*tp_vectorcall_offset*/
26047 : #endif
26048 : 0, /*tp_getattr*/
26049 : 0, /*tp_setattr*/
26050 : #if PY_MAJOR_VERSION < 3
26051 : 0, /*tp_compare*/
26052 : #endif
26053 : #if PY_MAJOR_VERSION >= 3
26054 : 0, /*tp_as_async*/
26055 : #endif
26056 : 0, /*tp_repr*/
26057 : 0, /*tp_as_number*/
26058 : &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
26059 : &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
26060 : 0, /*tp_hash*/
26061 : 0, /*tp_call*/
26062 : 0, /*tp_str*/
26063 : __pyx_tp_getattro_array, /*tp_getattro*/
26064 : 0, /*tp_setattro*/
26065 : &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
26066 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
26067 : 0, /*tp_doc*/
26068 : 0, /*tp_traverse*/
26069 : 0, /*tp_clear*/
26070 : 0, /*tp_richcompare*/
26071 : 0, /*tp_weaklistoffset*/
26072 : 0, /*tp_iter*/
26073 : 0, /*tp_iternext*/
26074 : __pyx_methods_array, /*tp_methods*/
26075 : 0, /*tp_members*/
26076 : __pyx_getsets_array, /*tp_getset*/
26077 : 0, /*tp_base*/
26078 : 0, /*tp_dict*/
26079 : 0, /*tp_descr_get*/
26080 : 0, /*tp_descr_set*/
26081 : #if !CYTHON_USE_TYPE_SPECS
26082 : 0, /*tp_dictoffset*/
26083 : #endif
26084 : 0, /*tp_init*/
26085 : 0, /*tp_alloc*/
26086 : __pyx_tp_new_array, /*tp_new*/
26087 : 0, /*tp_free*/
26088 : 0, /*tp_is_gc*/
26089 : 0, /*tp_bases*/
26090 : 0, /*tp_mro*/
26091 : 0, /*tp_cache*/
26092 : 0, /*tp_subclasses*/
26093 : 0, /*tp_weaklist*/
26094 : 0, /*tp_del*/
26095 : 0, /*tp_version_tag*/
26096 : #if PY_VERSION_HEX >= 0x030400a1
26097 : #if CYTHON_USE_TP_FINALIZE
26098 : 0, /*tp_finalize*/
26099 : #else
26100 : NULL, /*tp_finalize*/
26101 : #endif
26102 : #endif
26103 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26104 : 0, /*tp_vectorcall*/
26105 : #endif
26106 : #if __PYX_NEED_TP_PRINT_SLOT == 1
26107 : 0, /*tp_print*/
26108 : #endif
26109 : #if PY_VERSION_HEX >= 0x030C0000
26110 : 0, /*tp_watched*/
26111 : #endif
26112 : #if PY_VERSION_HEX >= 0x030d00A4
26113 : 0, /*tp_versions_used*/
26114 : #endif
26115 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26116 : 0, /*tp_pypy_flags*/
26117 : #endif
26118 : };
26119 : #endif
26120 :
26121 5 : static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
26122 5 : struct __pyx_MemviewEnum_obj *p;
26123 5 : PyObject *o;
26124 : #if CYTHON_COMPILING_IN_LIMITED_API
26125 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
26126 : o = alloc_func(t, 0);
26127 : #else
26128 5 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
26129 5 : o = (*t->tp_alloc)(t, 0);
26130 : } else {
26131 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
26132 : }
26133 5 : if (unlikely(!o)) return 0;
26134 : #endif
26135 5 : p = ((struct __pyx_MemviewEnum_obj *)o);
26136 5 : p->name = Py_None; Py_INCREF(Py_None);
26137 : return o;
26138 : }
26139 :
26140 0 : static void __pyx_tp_dealloc_Enum(PyObject *o) {
26141 0 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
26142 : #if CYTHON_USE_TP_FINALIZE
26143 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26144 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
26145 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
26146 : }
26147 : }
26148 : #endif
26149 0 : PyObject_GC_UnTrack(o);
26150 0 : Py_CLEAR(p->name);
26151 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
26152 0 : (*Py_TYPE(o)->tp_free)(o);
26153 : #else
26154 : {
26155 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
26156 : if (tp_free) tp_free(o);
26157 : }
26158 : #endif
26159 : }
26160 :
26161 305 : static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
26162 305 : int e;
26163 305 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
26164 305 : if (p->name) {
26165 305 : e = (*v)(p->name, a); if (e) return e;
26166 : }
26167 : return 0;
26168 : }
26169 :
26170 0 : static int __pyx_tp_clear_Enum(PyObject *o) {
26171 0 : PyObject* tmp;
26172 0 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
26173 0 : tmp = ((PyObject*)p->name);
26174 0 : p->name = Py_None; Py_INCREF(Py_None);
26175 0 : Py_XDECREF(tmp);
26176 0 : return 0;
26177 : }
26178 :
26179 0 : static PyObject *__pyx_specialmethod___pyx_MemviewEnum___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
26180 0 : return __pyx_MemviewEnum___repr__(self);
26181 : }
26182 :
26183 : static PyMethodDef __pyx_methods_Enum[] = {
26184 : {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_MemviewEnum___repr__, METH_NOARGS|METH_COEXIST, 0},
26185 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26186 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26187 : {0, 0, 0, 0}
26188 : };
26189 : #if CYTHON_USE_TYPE_SPECS
26190 : static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
26191 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
26192 : {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
26193 : {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
26194 : {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
26195 : {Py_tp_methods, (void *)__pyx_methods_Enum},
26196 : {Py_tp_init, (void *)__pyx_MemviewEnum___init__},
26197 : {Py_tp_new, (void *)__pyx_tp_new_Enum},
26198 : {0, 0},
26199 : };
26200 : static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
26201 : "scipy.sparse.csgraph._matching.Enum",
26202 : sizeof(struct __pyx_MemviewEnum_obj),
26203 : 0,
26204 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26205 : __pyx_type___pyx_MemviewEnum_slots,
26206 : };
26207 : #else
26208 :
26209 : static PyTypeObject __pyx_type___pyx_MemviewEnum = {
26210 : PyVarObject_HEAD_INIT(0, 0)
26211 : "scipy.sparse.csgraph._matching.""Enum", /*tp_name*/
26212 : sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
26213 : 0, /*tp_itemsize*/
26214 : __pyx_tp_dealloc_Enum, /*tp_dealloc*/
26215 : #if PY_VERSION_HEX < 0x030800b4
26216 : 0, /*tp_print*/
26217 : #endif
26218 : #if PY_VERSION_HEX >= 0x030800b4
26219 : 0, /*tp_vectorcall_offset*/
26220 : #endif
26221 : 0, /*tp_getattr*/
26222 : 0, /*tp_setattr*/
26223 : #if PY_MAJOR_VERSION < 3
26224 : 0, /*tp_compare*/
26225 : #endif
26226 : #if PY_MAJOR_VERSION >= 3
26227 : 0, /*tp_as_async*/
26228 : #endif
26229 : __pyx_MemviewEnum___repr__, /*tp_repr*/
26230 : 0, /*tp_as_number*/
26231 : 0, /*tp_as_sequence*/
26232 : 0, /*tp_as_mapping*/
26233 : 0, /*tp_hash*/
26234 : 0, /*tp_call*/
26235 : 0, /*tp_str*/
26236 : 0, /*tp_getattro*/
26237 : 0, /*tp_setattro*/
26238 : 0, /*tp_as_buffer*/
26239 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26240 : 0, /*tp_doc*/
26241 : __pyx_tp_traverse_Enum, /*tp_traverse*/
26242 : __pyx_tp_clear_Enum, /*tp_clear*/
26243 : 0, /*tp_richcompare*/
26244 : 0, /*tp_weaklistoffset*/
26245 : 0, /*tp_iter*/
26246 : 0, /*tp_iternext*/
26247 : __pyx_methods_Enum, /*tp_methods*/
26248 : 0, /*tp_members*/
26249 : 0, /*tp_getset*/
26250 : 0, /*tp_base*/
26251 : 0, /*tp_dict*/
26252 : 0, /*tp_descr_get*/
26253 : 0, /*tp_descr_set*/
26254 : #if !CYTHON_USE_TYPE_SPECS
26255 : 0, /*tp_dictoffset*/
26256 : #endif
26257 : __pyx_MemviewEnum___init__, /*tp_init*/
26258 : 0, /*tp_alloc*/
26259 : __pyx_tp_new_Enum, /*tp_new*/
26260 : 0, /*tp_free*/
26261 : 0, /*tp_is_gc*/
26262 : 0, /*tp_bases*/
26263 : 0, /*tp_mro*/
26264 : 0, /*tp_cache*/
26265 : 0, /*tp_subclasses*/
26266 : 0, /*tp_weaklist*/
26267 : 0, /*tp_del*/
26268 : 0, /*tp_version_tag*/
26269 : #if PY_VERSION_HEX >= 0x030400a1
26270 : #if CYTHON_USE_TP_FINALIZE
26271 : 0, /*tp_finalize*/
26272 : #else
26273 : NULL, /*tp_finalize*/
26274 : #endif
26275 : #endif
26276 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26277 : 0, /*tp_vectorcall*/
26278 : #endif
26279 : #if __PYX_NEED_TP_PRINT_SLOT == 1
26280 : 0, /*tp_print*/
26281 : #endif
26282 : #if PY_VERSION_HEX >= 0x030C0000
26283 : 0, /*tp_watched*/
26284 : #endif
26285 : #if PY_VERSION_HEX >= 0x030d00A4
26286 : 0, /*tp_versions_used*/
26287 : #endif
26288 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26289 : 0, /*tp_pypy_flags*/
26290 : #endif
26291 : };
26292 : #endif
26293 : static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
26294 :
26295 2302 : static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
26296 2302 : struct __pyx_memoryview_obj *p;
26297 2302 : PyObject *o;
26298 : #if CYTHON_COMPILING_IN_LIMITED_API
26299 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
26300 : o = alloc_func(t, 0);
26301 : #else
26302 2302 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
26303 2302 : o = (*t->tp_alloc)(t, 0);
26304 : } else {
26305 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
26306 : }
26307 2302 : if (unlikely(!o)) return 0;
26308 : #endif
26309 2302 : p = ((struct __pyx_memoryview_obj *)o);
26310 2302 : p->__pyx_vtab = __pyx_vtabptr_memoryview;
26311 2302 : p->obj = Py_None; Py_INCREF(Py_None);
26312 2302 : p->_size = Py_None; Py_INCREF(Py_None);
26313 2302 : p->_array_interface = Py_None; Py_INCREF(Py_None);
26314 2302 : p->view.obj = NULL;
26315 2302 : if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
26316 : return o;
26317 0 : bad:
26318 0 : Py_DECREF(o); o = 0;
26319 : return NULL;
26320 : }
26321 :
26322 2302 : static void __pyx_tp_dealloc_memoryview(PyObject *o) {
26323 2302 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26324 : #if CYTHON_USE_TP_FINALIZE
26325 2302 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26326 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
26327 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
26328 : }
26329 : }
26330 : #endif
26331 2302 : PyObject_GC_UnTrack(o);
26332 : {
26333 2302 : PyObject *etype, *eval, *etb;
26334 2302 : PyErr_Fetch(&etype, &eval, &etb);
26335 2302 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
26336 2302 : __pyx_memoryview___dealloc__(o);
26337 2302 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
26338 2302 : PyErr_Restore(etype, eval, etb);
26339 : }
26340 2302 : Py_CLEAR(p->obj);
26341 2302 : Py_CLEAR(p->_size);
26342 2302 : Py_CLEAR(p->_array_interface);
26343 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
26344 2302 : (*Py_TYPE(o)->tp_free)(o);
26345 : #else
26346 : {
26347 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
26348 : if (tp_free) tp_free(o);
26349 : }
26350 : #endif
26351 : }
26352 :
26353 0 : static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
26354 0 : int e;
26355 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26356 0 : if (p->obj) {
26357 0 : e = (*v)(p->obj, a); if (e) return e;
26358 : }
26359 0 : if (p->_size) {
26360 0 : e = (*v)(p->_size, a); if (e) return e;
26361 : }
26362 0 : if (p->_array_interface) {
26363 0 : e = (*v)(p->_array_interface, a); if (e) return e;
26364 : }
26365 0 : if (p->view.obj) {
26366 0 : e = (*v)(p->view.obj, a); if (e) return e;
26367 : }
26368 : return 0;
26369 : }
26370 :
26371 0 : static int __pyx_tp_clear_memoryview(PyObject *o) {
26372 0 : PyObject* tmp;
26373 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26374 0 : tmp = ((PyObject*)p->obj);
26375 0 : p->obj = Py_None; Py_INCREF(Py_None);
26376 0 : Py_XDECREF(tmp);
26377 0 : tmp = ((PyObject*)p->_size);
26378 0 : p->_size = Py_None; Py_INCREF(Py_None);
26379 0 : Py_XDECREF(tmp);
26380 0 : tmp = ((PyObject*)p->_array_interface);
26381 0 : p->_array_interface = Py_None; Py_INCREF(Py_None);
26382 0 : Py_XDECREF(tmp);
26383 0 : Py_CLEAR(p->view.obj);
26384 0 : return 0;
26385 : }
26386 0 : static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
26387 0 : PyObject *r;
26388 0 : PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
26389 0 : r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
26390 0 : Py_DECREF(x);
26391 : return r;
26392 : }
26393 :
26394 0 : static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
26395 0 : if (v) {
26396 0 : return __pyx_memoryview___setitem__(o, i, v);
26397 : }
26398 : else {
26399 0 : __Pyx_TypeName o_type_name;
26400 0 : o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
26401 0 : PyErr_Format(PyExc_NotImplementedError,
26402 : "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
26403 0 : __Pyx_DECREF_TypeName(o_type_name);
26404 0 : return -1;
26405 : }
26406 : }
26407 :
26408 0 : static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
26409 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
26410 : }
26411 :
26412 0 : static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
26413 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
26414 : }
26415 :
26416 0 : static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
26417 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
26418 : }
26419 :
26420 0 : static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
26421 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
26422 : }
26423 :
26424 0 : static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
26425 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
26426 : }
26427 :
26428 0 : static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
26429 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
26430 : }
26431 :
26432 0 : static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
26433 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
26434 : }
26435 :
26436 0 : static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
26437 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
26438 : }
26439 :
26440 0 : static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
26441 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
26442 : }
26443 :
26444 0 : static PyObject *__pyx_specialmethod___pyx_memoryview___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
26445 0 : return __pyx_memoryview___repr__(self);
26446 : }
26447 :
26448 : static PyMethodDef __pyx_methods_memoryview[] = {
26449 : {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_memoryview___repr__, METH_NOARGS|METH_COEXIST, 0},
26450 : {"is_c_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26451 : {"is_f_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26452 : {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26453 : {"copy_fortran", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26454 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26455 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26456 : {0, 0, 0, 0}
26457 : };
26458 :
26459 : static struct PyGetSetDef __pyx_getsets_memoryview[] = {
26460 : {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
26461 : {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
26462 : {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
26463 : {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
26464 : {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
26465 : {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
26466 : {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
26467 : {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
26468 : {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
26469 : {0, 0, 0, 0, 0}
26470 : };
26471 : #if CYTHON_USE_TYPE_SPECS
26472 : #if !CYTHON_COMPILING_IN_LIMITED_API
26473 :
26474 : static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
26475 : #if PY_MAJOR_VERSION < 3
26476 : 0, /*bf_getreadbuffer*/
26477 : #endif
26478 : #if PY_MAJOR_VERSION < 3
26479 : 0, /*bf_getwritebuffer*/
26480 : #endif
26481 : #if PY_MAJOR_VERSION < 3
26482 : 0, /*bf_getsegcount*/
26483 : #endif
26484 : #if PY_MAJOR_VERSION < 3
26485 : 0, /*bf_getcharbuffer*/
26486 : #endif
26487 : __pyx_memoryview_getbuffer, /*bf_getbuffer*/
26488 : 0, /*bf_releasebuffer*/
26489 : };
26490 : #endif
26491 : static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
26492 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
26493 : {Py_tp_repr, (void *)__pyx_memoryview___repr__},
26494 : {Py_sq_length, (void *)__pyx_memoryview___len__},
26495 : {Py_sq_item, (void *)__pyx_sq_item_memoryview},
26496 : {Py_mp_length, (void *)__pyx_memoryview___len__},
26497 : {Py_mp_subscript, (void *)__pyx_memoryview___getitem__},
26498 : {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
26499 : {Py_tp_str, (void *)__pyx_memoryview___str__},
26500 : #if defined(Py_bf_getbuffer)
26501 : {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
26502 : #endif
26503 : {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
26504 : {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
26505 : {Py_tp_methods, (void *)__pyx_methods_memoryview},
26506 : {Py_tp_getset, (void *)__pyx_getsets_memoryview},
26507 : {Py_tp_new, (void *)__pyx_tp_new_memoryview},
26508 : {0, 0},
26509 : };
26510 : static PyType_Spec __pyx_type___pyx_memoryview_spec = {
26511 : "scipy.sparse.csgraph._matching.memoryview",
26512 : sizeof(struct __pyx_memoryview_obj),
26513 : 0,
26514 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26515 : __pyx_type___pyx_memoryview_slots,
26516 : };
26517 : #else
26518 :
26519 : static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
26520 : __pyx_memoryview___len__, /*sq_length*/
26521 : 0, /*sq_concat*/
26522 : 0, /*sq_repeat*/
26523 : __pyx_sq_item_memoryview, /*sq_item*/
26524 : 0, /*sq_slice*/
26525 : 0, /*sq_ass_item*/
26526 : 0, /*sq_ass_slice*/
26527 : 0, /*sq_contains*/
26528 : 0, /*sq_inplace_concat*/
26529 : 0, /*sq_inplace_repeat*/
26530 : };
26531 :
26532 : static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
26533 : __pyx_memoryview___len__, /*mp_length*/
26534 : __pyx_memoryview___getitem__, /*mp_subscript*/
26535 : __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
26536 : };
26537 :
26538 : static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
26539 : #if PY_MAJOR_VERSION < 3
26540 : 0, /*bf_getreadbuffer*/
26541 : #endif
26542 : #if PY_MAJOR_VERSION < 3
26543 : 0, /*bf_getwritebuffer*/
26544 : #endif
26545 : #if PY_MAJOR_VERSION < 3
26546 : 0, /*bf_getsegcount*/
26547 : #endif
26548 : #if PY_MAJOR_VERSION < 3
26549 : 0, /*bf_getcharbuffer*/
26550 : #endif
26551 : __pyx_memoryview_getbuffer, /*bf_getbuffer*/
26552 : 0, /*bf_releasebuffer*/
26553 : };
26554 :
26555 : static PyTypeObject __pyx_type___pyx_memoryview = {
26556 : PyVarObject_HEAD_INIT(0, 0)
26557 : "scipy.sparse.csgraph._matching.""memoryview", /*tp_name*/
26558 : sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
26559 : 0, /*tp_itemsize*/
26560 : __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
26561 : #if PY_VERSION_HEX < 0x030800b4
26562 : 0, /*tp_print*/
26563 : #endif
26564 : #if PY_VERSION_HEX >= 0x030800b4
26565 : 0, /*tp_vectorcall_offset*/
26566 : #endif
26567 : 0, /*tp_getattr*/
26568 : 0, /*tp_setattr*/
26569 : #if PY_MAJOR_VERSION < 3
26570 : 0, /*tp_compare*/
26571 : #endif
26572 : #if PY_MAJOR_VERSION >= 3
26573 : 0, /*tp_as_async*/
26574 : #endif
26575 : __pyx_memoryview___repr__, /*tp_repr*/
26576 : 0, /*tp_as_number*/
26577 : &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
26578 : &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
26579 : 0, /*tp_hash*/
26580 : 0, /*tp_call*/
26581 : __pyx_memoryview___str__, /*tp_str*/
26582 : 0, /*tp_getattro*/
26583 : 0, /*tp_setattro*/
26584 : &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
26585 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26586 : 0, /*tp_doc*/
26587 : __pyx_tp_traverse_memoryview, /*tp_traverse*/
26588 : __pyx_tp_clear_memoryview, /*tp_clear*/
26589 : 0, /*tp_richcompare*/
26590 : 0, /*tp_weaklistoffset*/
26591 : 0, /*tp_iter*/
26592 : 0, /*tp_iternext*/
26593 : __pyx_methods_memoryview, /*tp_methods*/
26594 : 0, /*tp_members*/
26595 : __pyx_getsets_memoryview, /*tp_getset*/
26596 : 0, /*tp_base*/
26597 : 0, /*tp_dict*/
26598 : 0, /*tp_descr_get*/
26599 : 0, /*tp_descr_set*/
26600 : #if !CYTHON_USE_TYPE_SPECS
26601 : 0, /*tp_dictoffset*/
26602 : #endif
26603 : 0, /*tp_init*/
26604 : 0, /*tp_alloc*/
26605 : __pyx_tp_new_memoryview, /*tp_new*/
26606 : 0, /*tp_free*/
26607 : 0, /*tp_is_gc*/
26608 : 0, /*tp_bases*/
26609 : 0, /*tp_mro*/
26610 : 0, /*tp_cache*/
26611 : 0, /*tp_subclasses*/
26612 : 0, /*tp_weaklist*/
26613 : 0, /*tp_del*/
26614 : 0, /*tp_version_tag*/
26615 : #if PY_VERSION_HEX >= 0x030400a1
26616 : #if CYTHON_USE_TP_FINALIZE
26617 : 0, /*tp_finalize*/
26618 : #else
26619 : NULL, /*tp_finalize*/
26620 : #endif
26621 : #endif
26622 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26623 : 0, /*tp_vectorcall*/
26624 : #endif
26625 : #if __PYX_NEED_TP_PRINT_SLOT == 1
26626 : 0, /*tp_print*/
26627 : #endif
26628 : #if PY_VERSION_HEX >= 0x030C0000
26629 : 0, /*tp_watched*/
26630 : #endif
26631 : #if PY_VERSION_HEX >= 0x030d00A4
26632 : 0, /*tp_versions_used*/
26633 : #endif
26634 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26635 : 0, /*tp_pypy_flags*/
26636 : #endif
26637 : };
26638 : #endif
26639 : static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
26640 :
26641 338 : static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
26642 338 : struct __pyx_memoryviewslice_obj *p;
26643 338 : PyObject *o = __pyx_tp_new_memoryview(t, a, k);
26644 338 : if (unlikely(!o)) return 0;
26645 338 : p = ((struct __pyx_memoryviewslice_obj *)o);
26646 338 : p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
26647 338 : p->from_object = Py_None; Py_INCREF(Py_None);
26648 338 : p->from_slice.memview = NULL;
26649 338 : return o;
26650 : }
26651 :
26652 338 : static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
26653 338 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26654 : #if CYTHON_USE_TP_FINALIZE
26655 338 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26656 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
26657 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
26658 : }
26659 : }
26660 : #endif
26661 338 : PyObject_GC_UnTrack(o);
26662 : {
26663 338 : PyObject *etype, *eval, *etb;
26664 338 : PyErr_Fetch(&etype, &eval, &etb);
26665 338 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
26666 338 : __pyx_memoryviewslice___dealloc__(o);
26667 338 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
26668 338 : PyErr_Restore(etype, eval, etb);
26669 : }
26670 338 : Py_CLEAR(p->from_object);
26671 338 : PyObject_GC_Track(o);
26672 338 : __pyx_tp_dealloc_memoryview(o);
26673 : }
26674 :
26675 0 : static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
26676 0 : int e;
26677 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26678 0 : e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
26679 0 : if (p->from_object) {
26680 0 : e = (*v)(p->from_object, a); if (e) return e;
26681 : }
26682 : return 0;
26683 : }
26684 :
26685 0 : static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
26686 0 : PyObject* tmp;
26687 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26688 0 : __pyx_tp_clear_memoryview(o);
26689 0 : tmp = ((PyObject*)p->from_object);
26690 0 : p->from_object = Py_None; Py_INCREF(Py_None);
26691 0 : Py_XDECREF(tmp);
26692 0 : __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
26693 0 : return 0;
26694 : }
26695 :
26696 : static PyMethodDef __pyx_methods__memoryviewslice[] = {
26697 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26698 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26699 : {0, 0, 0, 0}
26700 : };
26701 : #if CYTHON_USE_TYPE_SPECS
26702 : static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
26703 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
26704 : {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
26705 : {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
26706 : {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
26707 : {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
26708 : {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
26709 : {0, 0},
26710 : };
26711 : static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
26712 : "scipy.sparse.csgraph._matching._memoryviewslice",
26713 : sizeof(struct __pyx_memoryviewslice_obj),
26714 : 0,
26715 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
26716 : __pyx_type___pyx_memoryviewslice_slots,
26717 : };
26718 : #else
26719 :
26720 : static PyTypeObject __pyx_type___pyx_memoryviewslice = {
26721 : PyVarObject_HEAD_INIT(0, 0)
26722 : "scipy.sparse.csgraph._matching.""_memoryviewslice", /*tp_name*/
26723 : sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
26724 : 0, /*tp_itemsize*/
26725 : __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
26726 : #if PY_VERSION_HEX < 0x030800b4
26727 : 0, /*tp_print*/
26728 : #endif
26729 : #if PY_VERSION_HEX >= 0x030800b4
26730 : 0, /*tp_vectorcall_offset*/
26731 : #endif
26732 : 0, /*tp_getattr*/
26733 : 0, /*tp_setattr*/
26734 : #if PY_MAJOR_VERSION < 3
26735 : 0, /*tp_compare*/
26736 : #endif
26737 : #if PY_MAJOR_VERSION >= 3
26738 : 0, /*tp_as_async*/
26739 : #endif
26740 : #if CYTHON_COMPILING_IN_PYPY || 0
26741 : __pyx_memoryview___repr__, /*tp_repr*/
26742 : #else
26743 : 0, /*tp_repr*/
26744 : #endif
26745 : 0, /*tp_as_number*/
26746 : 0, /*tp_as_sequence*/
26747 : 0, /*tp_as_mapping*/
26748 : 0, /*tp_hash*/
26749 : 0, /*tp_call*/
26750 : #if CYTHON_COMPILING_IN_PYPY || 0
26751 : __pyx_memoryview___str__, /*tp_str*/
26752 : #else
26753 : 0, /*tp_str*/
26754 : #endif
26755 : 0, /*tp_getattro*/
26756 : 0, /*tp_setattro*/
26757 : 0, /*tp_as_buffer*/
26758 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
26759 : PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
26760 : __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
26761 : __pyx_tp_clear__memoryviewslice, /*tp_clear*/
26762 : 0, /*tp_richcompare*/
26763 : 0, /*tp_weaklistoffset*/
26764 : 0, /*tp_iter*/
26765 : 0, /*tp_iternext*/
26766 : __pyx_methods__memoryviewslice, /*tp_methods*/
26767 : 0, /*tp_members*/
26768 : 0, /*tp_getset*/
26769 : 0, /*tp_base*/
26770 : 0, /*tp_dict*/
26771 : 0, /*tp_descr_get*/
26772 : 0, /*tp_descr_set*/
26773 : #if !CYTHON_USE_TYPE_SPECS
26774 : 0, /*tp_dictoffset*/
26775 : #endif
26776 : 0, /*tp_init*/
26777 : 0, /*tp_alloc*/
26778 : __pyx_tp_new__memoryviewslice, /*tp_new*/
26779 : 0, /*tp_free*/
26780 : 0, /*tp_is_gc*/
26781 : 0, /*tp_bases*/
26782 : 0, /*tp_mro*/
26783 : 0, /*tp_cache*/
26784 : 0, /*tp_subclasses*/
26785 : 0, /*tp_weaklist*/
26786 : 0, /*tp_del*/
26787 : 0, /*tp_version_tag*/
26788 : #if PY_VERSION_HEX >= 0x030400a1
26789 : #if CYTHON_USE_TP_FINALIZE
26790 : 0, /*tp_finalize*/
26791 : #else
26792 : NULL, /*tp_finalize*/
26793 : #endif
26794 : #endif
26795 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26796 : 0, /*tp_vectorcall*/
26797 : #endif
26798 : #if __PYX_NEED_TP_PRINT_SLOT == 1
26799 : 0, /*tp_print*/
26800 : #endif
26801 : #if PY_VERSION_HEX >= 0x030C0000
26802 : 0, /*tp_watched*/
26803 : #endif
26804 : #if PY_VERSION_HEX >= 0x030d00A4
26805 : 0, /*tp_versions_used*/
26806 : #endif
26807 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26808 : 0, /*tp_pypy_flags*/
26809 : #endif
26810 : };
26811 : #endif
26812 :
26813 : static PyMethodDef __pyx_methods[] = {
26814 : {0, 0, 0, 0}
26815 : };
26816 : #ifndef CYTHON_SMALL_CODE
26817 : #if defined(__clang__)
26818 : #define CYTHON_SMALL_CODE
26819 : #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
26820 : #define CYTHON_SMALL_CODE __attribute__((cold))
26821 : #else
26822 : #define CYTHON_SMALL_CODE
26823 : #endif
26824 : #endif
26825 : /* #### Code section: pystring_table ### */
26826 :
26827 1 : static int __Pyx_CreateStringTabAndInitStrings(void) {
26828 1 : __Pyx_StringTabEntry __pyx_string_tab[] = {
26829 1 : {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
26830 1 : {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
26831 1 : {&__pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_k_All_dimensions_preceding_dimensi, sizeof(__pyx_k_All_dimensions_preceding_dimensi), 0, 0, 1, 0},
26832 1 : {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
26833 1 : {&__pyx_n_s_BTYPE, __pyx_k_BTYPE, sizeof(__pyx_k_BTYPE), 0, 0, 1, 1},
26834 1 : {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
26835 1 : {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
26836 1 : {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
26837 1 : {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
26838 1 : {&__pyx_kp_u_Cannot_index_with_type, __pyx_k_Cannot_index_with_type, sizeof(__pyx_k_Cannot_index_with_type), 0, 1, 0, 0},
26839 1 : {&__pyx_kp_s_Cannot_transpose_memoryview_with, __pyx_k_Cannot_transpose_memoryview_with, sizeof(__pyx_k_Cannot_transpose_memoryview_with), 0, 0, 1, 0},
26840 1 : {&__pyx_n_s_DTYPE, __pyx_k_DTYPE, sizeof(__pyx_k_DTYPE), 0, 0, 1, 1},
26841 1 : {&__pyx_kp_s_Dimension_d_is_not_direct, __pyx_k_Dimension_d_is_not_direct, sizeof(__pyx_k_Dimension_d_is_not_direct), 0, 0, 1, 0},
26842 1 : {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
26843 1 : {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
26844 1 : {&__pyx_n_s_ITYPE, __pyx_k_ITYPE, sizeof(__pyx_k_ITYPE), 0, 0, 1, 1},
26845 1 : {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
26846 1 : {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
26847 1 : {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
26848 1 : {&__pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_k_Index_out_of_bounds_axis_d, sizeof(__pyx_k_Index_out_of_bounds_axis_d), 0, 0, 1, 0},
26849 1 : {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
26850 1 : {&__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 1, 0, 0},
26851 1 : {&__pyx_kp_u_Invalid_shape_in_axis, __pyx_k_Invalid_shape_in_axis, sizeof(__pyx_k_Invalid_shape_in_axis), 0, 1, 0, 0},
26852 1 : {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
26853 1 : {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
26854 1 : {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
26855 1 : {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
26856 1 : {&__pyx_kp_u_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 1, 0, 0},
26857 1 : {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
26858 1 : {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
26859 1 : {&__pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_k_Step_may_not_be_zero_axis_d, sizeof(__pyx_k_Step_may_not_be_zero_axis_d), 0, 0, 1, 0},
26860 1 : {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
26861 1 : {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
26862 1 : {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
26863 1 : {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
26864 1 : {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
26865 1 : {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
26866 1 : {&__pyx_n_s__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 1, 1},
26867 1 : {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1},
26868 1 : {&__pyx_n_s__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 1, 1},
26869 1 : {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
26870 1 : {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
26871 1 : {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
26872 1 : {&__pyx_n_s_abc, __pyx_k_abc, sizeof(__pyx_k_abc), 0, 0, 1, 1},
26873 1 : {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
26874 1 : {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
26875 1 : {&__pyx_kp_u_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0, 0},
26876 1 : {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1},
26877 1 : {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1},
26878 1 : {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
26879 1 : {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
26880 1 : {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
26881 1 : {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
26882 1 : {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
26883 1 : {&__pyx_n_s_biadjacency_matrix, __pyx_k_biadjacency_matrix, sizeof(__pyx_k_biadjacency_matrix), 0, 0, 1, 1},
26884 1 : {&__pyx_n_s_biadjacency_matrix_t, __pyx_k_biadjacency_matrix_t, sizeof(__pyx_k_biadjacency_matrix_t), 0, 0, 1, 1},
26885 1 : {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
26886 1 : {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
26887 1 : {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
26888 1 : {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
26889 1 : {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
26890 1 : {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
26891 1 : {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
26892 1 : {&__pyx_kp_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 0},
26893 1 : {&__pyx_n_u_column, __pyx_k_column, sizeof(__pyx_k_column), 0, 1, 0, 1},
26894 1 : {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
26895 1 : {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
26896 1 : {&__pyx_n_s_convert_pydata_sparse_to_scipy, __pyx_k_convert_pydata_sparse_to_scipy, sizeof(__pyx_k_convert_pydata_sparse_to_scipy), 0, 0, 1, 1},
26897 1 : {&__pyx_n_u_coo, __pyx_k_coo, sizeof(__pyx_k_coo), 0, 1, 0, 1},
26898 1 : {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
26899 1 : {&__pyx_n_u_csc, __pyx_k_csc, sizeof(__pyx_k_csc), 0, 1, 0, 1},
26900 1 : {&__pyx_n_u_csr, __pyx_k_csr, sizeof(__pyx_k_csr), 0, 1, 0, 1},
26901 1 : {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
26902 1 : {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
26903 1 : {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
26904 1 : {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1},
26905 1 : {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
26906 1 : {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
26907 1 : {&__pyx_n_s_eliminate_zeros, __pyx_k_eliminate_zeros, sizeof(__pyx_k_eliminate_zeros), 0, 0, 1, 1},
26908 1 : {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
26909 1 : {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
26910 1 : {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
26911 1 : {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
26912 1 : {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
26913 1 : {&__pyx_kp_u_expected_a_matrix_containing_num, __pyx_k_expected_a_matrix_containing_num, sizeof(__pyx_k_expected_a_matrix_containing_num), 0, 1, 0, 0},
26914 1 : {&__pyx_kp_u_explicit_zero_weights_are_remove, __pyx_k_explicit_zero_weights_are_remove, sizeof(__pyx_k_explicit_zero_weights_are_remove), 0, 1, 0, 0},
26915 1 : {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
26916 1 : {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
26917 1 : {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
26918 1 : {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
26919 1 : {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
26920 1 : {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
26921 1 : {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
26922 1 : {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0},
26923 1 : {&__pyx_kp_u_got_2, __pyx_k_got_2, sizeof(__pyx_k_got_2), 0, 1, 0, 0},
26924 1 : {&__pyx_kp_u_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 1, 0, 0},
26925 1 : {&__pyx_n_s_graph, __pyx_k_graph, sizeof(__pyx_k_graph), 0, 0, 1, 1},
26926 1 : {&__pyx_kp_u_graph_must_be_in_CSC_CSR_or_COO, __pyx_k_graph_must_be_in_CSC_CSR_or_COO, sizeof(__pyx_k_graph_must_be_in_CSC_CSR_or_COO), 0, 1, 0, 0},
26927 1 : {&__pyx_kp_u_graph_must_be_sparse, __pyx_k_graph_must_be_sparse, sizeof(__pyx_k_graph_must_be_sparse), 0, 1, 0, 0},
26928 1 : {&__pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_k_home_czgdp18079_Quansight_scipy, sizeof(__pyx_k_home_czgdp18079_Quansight_scipy), 0, 0, 1, 0},
26929 1 : {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
26930 1 : {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
26931 1 : {&__pyx_n_s_iinfo, __pyx_k_iinfo, sizeof(__pyx_k_iinfo), 0, 0, 1, 1},
26932 1 : {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
26933 1 : {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
26934 1 : {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
26935 1 : {&__pyx_n_s_indptr, __pyx_k_indptr, sizeof(__pyx_k_indptr), 0, 0, 1, 1},
26936 1 : {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
26937 1 : {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
26938 1 : {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
26939 1 : {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
26940 1 : {&__pyx_n_s_isposinf, __pyx_k_isposinf, sizeof(__pyx_k_isposinf), 0, 0, 1, 1},
26941 1 : {&__pyx_n_s_issparse, __pyx_k_issparse, sizeof(__pyx_k_issparse), 0, 0, 1, 1},
26942 1 : {&__pyx_n_s_issubdtype, __pyx_k_issubdtype, sizeof(__pyx_k_issubdtype), 0, 0, 1, 1},
26943 1 : {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
26944 1 : {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
26945 1 : {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
26946 1 : {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
26947 1 : {&__pyx_n_s_matching, __pyx_k_matching, sizeof(__pyx_k_matching), 0, 0, 1, 1},
26948 1 : {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
26949 1 : {&__pyx_n_s_maximize, __pyx_k_maximize, sizeof(__pyx_k_maximize), 0, 0, 1, 1},
26950 1 : {&__pyx_n_s_maximum_bipartite_matching, __pyx_k_maximum_bipartite_matching, sizeof(__pyx_k_maximum_bipartite_matching), 0, 0, 1, 1},
26951 1 : {&__pyx_kp_u_maximum_bipartite_matching_grap, __pyx_k_maximum_bipartite_matching_grap, sizeof(__pyx_k_maximum_bipartite_matching_grap), 0, 1, 0, 0},
26952 1 : {&__pyx_kp_u_maximum_bipartite_matching_line, __pyx_k_maximum_bipartite_matching_line, sizeof(__pyx_k_maximum_bipartite_matching_line), 0, 1, 0, 0},
26953 1 : {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
26954 1 : {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1},
26955 1 : {&__pyx_kp_u_min_weight_full_bipartite_match, __pyx_k_min_weight_full_bipartite_match, sizeof(__pyx_k_min_weight_full_bipartite_match), 0, 1, 0, 0},
26956 1 : {&__pyx_n_s_min_weight_full_bipartite_matchi, __pyx_k_min_weight_full_bipartite_matchi, sizeof(__pyx_k_min_weight_full_bipartite_matchi), 0, 0, 1, 1},
26957 1 : {&__pyx_kp_u_min_weight_full_bipartite_matchi_2, __pyx_k_min_weight_full_bipartite_matchi_2, sizeof(__pyx_k_min_weight_full_bipartite_matchi_2), 0, 1, 0, 0},
26958 1 : {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
26959 1 : {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
26960 1 : {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
26961 1 : {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
26962 1 : {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
26963 1 : {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
26964 1 : {&__pyx_kp_u_no_full_matching_exists, __pyx_k_no_full_matching_exists, sizeof(__pyx_k_no_full_matching_exists), 0, 1, 0, 0},
26965 1 : {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
26966 1 : {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
26967 1 : {&__pyx_kp_u_numpy__core_multiarray_failed_to, __pyx_k_numpy__core_multiarray_failed_to, sizeof(__pyx_k_numpy__core_multiarray_failed_to), 0, 1, 0, 0},
26968 1 : {&__pyx_kp_u_numpy__core_umath_failed_to_impo, __pyx_k_numpy__core_umath_failed_to_impo, sizeof(__pyx_k_numpy__core_umath_failed_to_impo), 0, 1, 0, 0},
26969 1 : {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
26970 1 : {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
26971 1 : {&__pyx_n_s_perm_type, __pyx_k_perm_type, sizeof(__pyx_k_perm_type), 0, 0, 1, 1},
26972 1 : {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
26973 1 : {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
26974 1 : {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
26975 1 : {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
26976 1 : {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
26977 1 : {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
26978 1 : {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
26979 1 : {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
26980 1 : {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
26981 1 : {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
26982 1 : {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
26983 1 : {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
26984 1 : {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},
26985 1 : {&__pyx_n_u_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 1, 0, 1},
26986 1 : {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse, sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
26987 1 : {&__pyx_n_s_scipy_sparse__sputils, __pyx_k_scipy_sparse__sputils, sizeof(__pyx_k_scipy_sparse__sputils), 0, 0, 1, 1},
26988 1 : {&__pyx_n_s_scipy_sparse_csgraph__matching, __pyx_k_scipy_sparse_csgraph__matching, sizeof(__pyx_k_scipy_sparse_csgraph__matching), 0, 0, 1, 1},
26989 1 : {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
26990 1 : {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
26991 1 : {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
26992 1 : {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
26993 1 : {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
26994 1 : {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
26995 1 : {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
26996 1 : {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
26997 1 : {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
26998 1 : {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
26999 1 : {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
27000 1 : {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
27001 1 : {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
27002 1 : {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
27003 1 : {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
27004 1 : {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
27005 1 : {&__pyx_n_s_tocsr, __pyx_k_tocsr, sizeof(__pyx_k_tocsr), 0, 0, 1, 1},
27006 1 : {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
27007 1 : {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
27008 1 : {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
27009 1 : {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
27010 1 : {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
27011 1 : {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
27012 1 : {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
27013 1 : {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
27014 1 : {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
27015 1 : {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
27016 1 : {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
27017 : {0, 0, 0, 0, 0, 0, 0}
27018 : };
27019 1 : return __Pyx_InitStrings(__pyx_string_tab);
27020 : }
27021 : /* #### Code section: cached_builtins ### */
27022 1 : static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
27023 1 : __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 139, __pyx_L1_error)
27024 1 : __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 172, __pyx_L1_error)
27025 1 : __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 463, __pyx_L1_error)
27026 1 : __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(1, 100, __pyx_L1_error)
27027 1 : __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 156, __pyx_L1_error)
27028 1 : __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 159, __pyx_L1_error)
27029 1 : __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(1, 373, __pyx_L1_error)
27030 1 : __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 408, __pyx_L1_error)
27031 1 : __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 618, __pyx_L1_error)
27032 1 : __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 914, __pyx_L1_error)
27033 1 : __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1025, __pyx_L1_error)
27034 : return 0;
27035 : __pyx_L1_error:;
27036 : return -1;
27037 : }
27038 : /* #### Code section: cached_constants ### */
27039 :
27040 1 : static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
27041 : __Pyx_RefNannyDeclarations
27042 1 : __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
27043 :
27044 : /* "View.MemoryView":582
27045 : * def suboffsets(self):
27046 : * if self.view.suboffsets == NULL:
27047 : * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
27048 : *
27049 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
27050 : */
27051 1 : __pyx_tuple__4 = PyTuple_New(1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 582, __pyx_L1_error)
27052 1 : __Pyx_GOTREF(__pyx_tuple__4);
27053 1 : __Pyx_INCREF(__pyx_int_neg_1);
27054 1 : __Pyx_GIVEREF(__pyx_int_neg_1);
27055 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_tuple__4, 0, __pyx_int_neg_1)) __PYX_ERR(1, 582, __pyx_L1_error);
27056 1 : __Pyx_GIVEREF(__pyx_tuple__4);
27057 :
27058 : /* "View.MemoryView":679
27059 : * tup = <tuple>index if isinstance(index, tuple) else (index,)
27060 : *
27061 : * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
27062 : * have_slices = False
27063 : * seen_ellipsis = False
27064 : */
27065 1 : __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(1, 679, __pyx_L1_error)
27066 1 : __Pyx_GOTREF(__pyx_slice__5);
27067 1 : __Pyx_GIVEREF(__pyx_slice__5);
27068 :
27069 : /* "(tree fragment)":4
27070 : * cdef object __pyx_PickleError
27071 : * cdef object __pyx_result
27072 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
27073 : * from pickle import PickleError as __pyx_PickleError
27074 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
27075 : */
27076 1 : __pyx_tuple__8 = PyTuple_Pack(3, __pyx_int_136983863, __pyx_int_112105877, __pyx_int_184977713); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error)
27077 1 : __Pyx_GOTREF(__pyx_tuple__8);
27078 1 : __Pyx_GIVEREF(__pyx_tuple__8);
27079 :
27080 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
27081 : * __pyx_import_array()
27082 : * except Exception:
27083 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
27084 : *
27085 : * cdef inline int import_umath() except -1:
27086 : */
27087 1 : __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 1025, __pyx_L1_error)
27088 1 : __Pyx_GOTREF(__pyx_tuple__9);
27089 1 : __Pyx_GIVEREF(__pyx_tuple__9);
27090 :
27091 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
27092 : * _import_umath()
27093 : * except Exception:
27094 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
27095 : *
27096 : * cdef inline int import_ufunc() except -1:
27097 : */
27098 1 : __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_umath_failed_to_impo); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 1031, __pyx_L1_error)
27099 1 : __Pyx_GOTREF(__pyx_tuple__10);
27100 1 : __Pyx_GIVEREF(__pyx_tuple__10);
27101 :
27102 : /* "scipy/sparse/csgraph/_matching.pyx":139
27103 : * graph = convert_pydata_sparse_to_scipy(graph)
27104 : * if not issparse(graph):
27105 : * raise TypeError("graph must be sparse") # <<<<<<<<<<<<<<
27106 : * if graph.format not in ("csr", "csc", "coo"):
27107 : * raise TypeError("graph must be in CSC, CSR, or COO format.")
27108 : */
27109 1 : __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_graph_must_be_sparse); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 139, __pyx_L1_error)
27110 1 : __Pyx_GOTREF(__pyx_tuple__11);
27111 1 : __Pyx_GIVEREF(__pyx_tuple__11);
27112 :
27113 : /* "scipy/sparse/csgraph/_matching.pyx":141
27114 : * raise TypeError("graph must be sparse")
27115 : * if graph.format not in ("csr", "csc", "coo"):
27116 : * raise TypeError("graph must be in CSC, CSR, or COO format.") # <<<<<<<<<<<<<<
27117 : * graph = graph.tocsr()
27118 : * i, j = graph.shape
27119 : */
27120 1 : __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_graph_must_be_in_CSC_CSR_or_COO); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 141, __pyx_L1_error)
27121 1 : __Pyx_GOTREF(__pyx_tuple__12);
27122 1 : __Pyx_GIVEREF(__pyx_tuple__12);
27123 :
27124 : /* "scipy/sparse/csgraph/_matching.pyx":498
27125 : * matching = np.asarray(matching)
27126 : * if np.sum(matching != -1) != min(i, j):
27127 : * raise ValueError('no full matching exists') # <<<<<<<<<<<<<<
27128 : * b = np.asarray(_lapjvsp(biadjacency_matrix_t.indptr,
27129 : * biadjacency_matrix_t.indices,
27130 : */
27131 1 : __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_no_full_matching_exists); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 498, __pyx_L1_error)
27132 1 : __Pyx_GOTREF(__pyx_tuple__13);
27133 1 : __Pyx_GIVEREF(__pyx_tuple__13);
27134 :
27135 : /* "View.MemoryView":100
27136 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27137 : * try:
27138 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
27139 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27140 : * else:
27141 : */
27142 1 : __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 100, __pyx_L1_error)
27143 1 : __Pyx_GOTREF(__pyx_tuple__14);
27144 1 : __Pyx_GIVEREF(__pyx_tuple__14);
27145 1 : __pyx_tuple__15 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 100, __pyx_L1_error)
27146 1 : __Pyx_GOTREF(__pyx_tuple__15);
27147 1 : __Pyx_GIVEREF(__pyx_tuple__15);
27148 :
27149 : /* "View.MemoryView":101
27150 : * try:
27151 : * if __import__("sys").version_info >= (3, 3):
27152 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
27153 : * else:
27154 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
27155 : */
27156 1 : __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_collections_abc); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 101, __pyx_L1_error)
27157 1 : __Pyx_GOTREF(__pyx_tuple__16);
27158 1 : __Pyx_GIVEREF(__pyx_tuple__16);
27159 :
27160 : /* "View.MemoryView":103
27161 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27162 : * else:
27163 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<<
27164 : * except:
27165 : *
27166 : */
27167 1 : __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_collections); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 103, __pyx_L1_error)
27168 1 : __Pyx_GOTREF(__pyx_tuple__17);
27169 1 : __Pyx_GIVEREF(__pyx_tuple__17);
27170 :
27171 : /* "View.MemoryView":309
27172 : * return self.name
27173 : *
27174 : * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
27175 : * cdef strided = Enum("<strided and direct>") # default
27176 : * cdef indirect = Enum("<strided and indirect>")
27177 : */
27178 1 : __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 309, __pyx_L1_error)
27179 1 : __Pyx_GOTREF(__pyx_tuple__18);
27180 1 : __Pyx_GIVEREF(__pyx_tuple__18);
27181 :
27182 : /* "View.MemoryView":310
27183 : *
27184 : * cdef generic = Enum("<strided and direct or indirect>")
27185 : * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
27186 : * cdef indirect = Enum("<strided and indirect>")
27187 : *
27188 : */
27189 1 : __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 310, __pyx_L1_error)
27190 1 : __Pyx_GOTREF(__pyx_tuple__19);
27191 1 : __Pyx_GIVEREF(__pyx_tuple__19);
27192 :
27193 : /* "View.MemoryView":311
27194 : * cdef generic = Enum("<strided and direct or indirect>")
27195 : * cdef strided = Enum("<strided and direct>") # default
27196 : * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
27197 : *
27198 : *
27199 : */
27200 1 : __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 311, __pyx_L1_error)
27201 1 : __Pyx_GOTREF(__pyx_tuple__20);
27202 1 : __Pyx_GIVEREF(__pyx_tuple__20);
27203 :
27204 : /* "View.MemoryView":314
27205 : *
27206 : *
27207 : * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
27208 : * cdef indirect_contiguous = Enum("<contiguous and indirect>")
27209 : *
27210 : */
27211 1 : __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 314, __pyx_L1_error)
27212 1 : __Pyx_GOTREF(__pyx_tuple__21);
27213 1 : __Pyx_GIVEREF(__pyx_tuple__21);
27214 :
27215 : /* "View.MemoryView":315
27216 : *
27217 : * cdef contiguous = Enum("<contiguous and direct>")
27218 : * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
27219 : *
27220 : *
27221 : */
27222 1 : __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 315, __pyx_L1_error)
27223 1 : __Pyx_GOTREF(__pyx_tuple__22);
27224 1 : __Pyx_GIVEREF(__pyx_tuple__22);
27225 :
27226 : /* "(tree fragment)":1
27227 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
27228 : * cdef object __pyx_PickleError
27229 : * cdef object __pyx_result
27230 : */
27231 1 : __pyx_tuple__23 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 1, __pyx_L1_error)
27232 1 : __Pyx_GOTREF(__pyx_tuple__23);
27233 1 : __Pyx_GIVEREF(__pyx_tuple__23);
27234 1 : __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(1, 1, __pyx_L1_error)
27235 :
27236 : /* "scipy/sparse/csgraph/_matching.pyx":17
27237 : *
27238 : *
27239 : * def maximum_bipartite_matching(graph, perm_type='row'): # <<<<<<<<<<<<<<
27240 : * r"""
27241 : * maximum_bipartite_matching(graph, perm_type='row')
27242 : */
27243 1 : __pyx_tuple__25 = PyTuple_Pack(6, __pyx_n_s_graph, __pyx_n_s_perm_type, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 17, __pyx_L1_error)
27244 1 : __Pyx_GOTREF(__pyx_tuple__25);
27245 1 : __Pyx_GIVEREF(__pyx_tuple__25);
27246 1 : __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_maximum_bipartite_matching, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 17, __pyx_L1_error)
27247 1 : __pyx_tuple__27 = PyTuple_Pack(1, ((PyObject*)__pyx_n_u_row)); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 17, __pyx_L1_error)
27248 1 : __Pyx_GOTREF(__pyx_tuple__27);
27249 1 : __Pyx_GIVEREF(__pyx_tuple__27);
27250 :
27251 : /* "scipy/sparse/csgraph/_matching.pyx":288
27252 : *
27253 : *
27254 : * def min_weight_full_bipartite_matching(biadjacency_matrix, maximize=False): # <<<<<<<<<<<<<<
27255 : * r"""
27256 : * min_weight_full_bipartite_matching(biadjacency_matrix, maximize=False)
27257 : */
27258 1 : __pyx_tuple__29 = PyTuple_Pack(10, __pyx_n_s_biadjacency_matrix, __pyx_n_s_maximize, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_a, __pyx_n_s_biadjacency_matrix_t, __pyx_n_s_matching, __pyx_n_s__28, __pyx_n_s_b, __pyx_n_s_indices); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 288, __pyx_L1_error)
27259 1 : __Pyx_GOTREF(__pyx_tuple__29);
27260 1 : __Pyx_GIVEREF(__pyx_tuple__29);
27261 1 : __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_min_weight_full_bipartite_matchi, 288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 288, __pyx_L1_error)
27262 1 : __pyx_tuple__31 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 288, __pyx_L1_error)
27263 : __Pyx_GOTREF(__pyx_tuple__31);
27264 : __Pyx_GIVEREF(__pyx_tuple__31);
27265 : __Pyx_RefNannyFinishContext();
27266 : return 0;
27267 : __pyx_L1_error:;
27268 : __Pyx_RefNannyFinishContext();
27269 : return -1;
27270 : }
27271 : /* #### Code section: init_constants ### */
27272 :
27273 1 : static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
27274 1 : if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
27275 1 : __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
27276 1 : __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27277 1 : __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
27278 1 : __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
27279 1 : __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
27280 1 : __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
27281 1 : __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27282 : return 0;
27283 : __pyx_L1_error:;
27284 : return -1;
27285 : }
27286 : /* #### Code section: init_globals ### */
27287 :
27288 1 : static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
27289 : /* AssertionsEnabled.init */
27290 1 : if (likely(__Pyx_init_assertions_enabled() == 0)); else
27291 :
27292 0 : if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
27293 :
27294 : return 0;
27295 0 : __pyx_L1_error:;
27296 0 : return -1;
27297 : }
27298 : /* #### Code section: init_module ### */
27299 :
27300 : static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
27301 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
27302 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
27303 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
27304 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
27305 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
27306 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
27307 :
27308 1 : static int __Pyx_modinit_global_init_code(void) {
27309 : __Pyx_RefNannyDeclarations
27310 1 : __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
27311 : /*--- Global init code ---*/
27312 1 : __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
27313 1 : generic = Py_None; Py_INCREF(Py_None);
27314 1 : strided = Py_None; Py_INCREF(Py_None);
27315 1 : indirect = Py_None; Py_INCREF(Py_None);
27316 1 : contiguous = Py_None; Py_INCREF(Py_None);
27317 1 : indirect_contiguous = Py_None; Py_INCREF(Py_None);
27318 1 : __Pyx_RefNannyFinishContext();
27319 1 : return 0;
27320 : }
27321 :
27322 : static int __Pyx_modinit_variable_export_code(void) {
27323 : __Pyx_RefNannyDeclarations
27324 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
27325 : /*--- Variable export code ---*/
27326 : __Pyx_RefNannyFinishContext();
27327 : return 0;
27328 : }
27329 :
27330 : static int __Pyx_modinit_function_export_code(void) {
27331 : __Pyx_RefNannyDeclarations
27332 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
27333 : /*--- Function export code ---*/
27334 : __Pyx_RefNannyFinishContext();
27335 : return 0;
27336 : }
27337 :
27338 1 : static int __Pyx_modinit_type_init_code(void) {
27339 : __Pyx_RefNannyDeclarations
27340 1 : PyObject *__pyx_t_1 = NULL;
27341 1 : int __pyx_lineno = 0;
27342 1 : const char *__pyx_filename = NULL;
27343 1 : int __pyx_clineno = 0;
27344 1 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
27345 : /*--- Type init code ---*/
27346 1 : __pyx_vtabptr_array = &__pyx_vtable_array;
27347 1 : __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
27348 : #if CYTHON_USE_TYPE_SPECS
27349 : __pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_array_type)) __PYX_ERR(1, 114, __pyx_L1_error)
27350 : #if !CYTHON_COMPILING_IN_LIMITED_API
27351 : __pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
27352 : if (!__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_array_type->tp_base->tp_as_buffer && __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
27353 : __pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
27354 : }
27355 : #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
27356 : /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
27357 : #elif defined(_MSC_VER)
27358 : #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
27359 : #else
27360 : #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
27361 : #endif
27362 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_array_spec, __pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
27363 : #else
27364 1 : __pyx_array_type = &__pyx_type___pyx_array;
27365 : #endif
27366 : #if !CYTHON_COMPILING_IN_LIMITED_API
27367 : #endif
27368 : #if !CYTHON_USE_TYPE_SPECS
27369 1 : if (__Pyx_PyType_Ready(__pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
27370 : #endif
27371 : #if PY_MAJOR_VERSION < 3
27372 : __pyx_array_type->tp_print = 0;
27373 : #endif
27374 1 : if (__Pyx_SetVtable(__pyx_array_type, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
27375 : #if !CYTHON_COMPILING_IN_LIMITED_API
27376 1 : if (__Pyx_MergeVtables(__pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
27377 : #endif
27378 : #if !CYTHON_COMPILING_IN_LIMITED_API
27379 1 : if (__Pyx_setup_reduce((PyObject *) __pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
27380 : #endif
27381 : #if CYTHON_USE_TYPE_SPECS
27382 : __pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_MemviewEnum_type)) __PYX_ERR(1, 302, __pyx_L1_error)
27383 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_MemviewEnum_spec, __pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
27384 : #else
27385 1 : __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
27386 : #endif
27387 : #if !CYTHON_COMPILING_IN_LIMITED_API
27388 : #endif
27389 : #if !CYTHON_USE_TYPE_SPECS
27390 1 : if (__Pyx_PyType_Ready(__pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
27391 : #endif
27392 : #if PY_MAJOR_VERSION < 3
27393 : __pyx_MemviewEnum_type->tp_print = 0;
27394 : #endif
27395 : #if !CYTHON_COMPILING_IN_LIMITED_API
27396 1 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_MemviewEnum_type->tp_dictoffset && __pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
27397 1 : __pyx_MemviewEnum_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
27398 : }
27399 : #endif
27400 : #if !CYTHON_COMPILING_IN_LIMITED_API
27401 1 : if (__Pyx_setup_reduce((PyObject *) __pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
27402 : #endif
27403 1 : __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
27404 1 : __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
27405 1 : __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
27406 1 : __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
27407 1 : __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
27408 1 : __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
27409 1 : __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
27410 1 : __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
27411 1 : __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
27412 : #if CYTHON_USE_TYPE_SPECS
27413 : __pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_memoryview_type)) __PYX_ERR(1, 337, __pyx_L1_error)
27414 : #if !CYTHON_COMPILING_IN_LIMITED_API
27415 : __pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
27416 : if (!__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
27417 : __pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
27418 : }
27419 : #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
27420 : /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
27421 : #elif defined(_MSC_VER)
27422 : #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
27423 : #else
27424 : #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
27425 : #endif
27426 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryview_spec, __pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
27427 : #else
27428 1 : __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
27429 : #endif
27430 : #if !CYTHON_COMPILING_IN_LIMITED_API
27431 : #endif
27432 : #if !CYTHON_USE_TYPE_SPECS
27433 1 : if (__Pyx_PyType_Ready(__pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
27434 : #endif
27435 : #if PY_MAJOR_VERSION < 3
27436 : __pyx_memoryview_type->tp_print = 0;
27437 : #endif
27438 : #if !CYTHON_COMPILING_IN_LIMITED_API
27439 1 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryview_type->tp_dictoffset && __pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
27440 1 : __pyx_memoryview_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
27441 : }
27442 : #endif
27443 1 : if (__Pyx_SetVtable(__pyx_memoryview_type, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
27444 : #if !CYTHON_COMPILING_IN_LIMITED_API
27445 1 : if (__Pyx_MergeVtables(__pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
27446 : #endif
27447 : #if !CYTHON_COMPILING_IN_LIMITED_API
27448 1 : if (__Pyx_setup_reduce((PyObject *) __pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
27449 : #endif
27450 1 : __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
27451 1 : __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
27452 1 : __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
27453 1 : __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
27454 1 : __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
27455 : #if CYTHON_USE_TYPE_SPECS
27456 : __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_memoryview_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 952, __pyx_L1_error)
27457 : __Pyx_GOTREF(__pyx_t_1);
27458 : __pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
27459 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27460 : if (unlikely(!__pyx_memoryviewslice_type)) __PYX_ERR(1, 952, __pyx_L1_error)
27461 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryviewslice_spec, __pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
27462 : #else
27463 1 : __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
27464 : #endif
27465 : #if !CYTHON_COMPILING_IN_LIMITED_API
27466 1 : __pyx_memoryviewslice_type->tp_base = __pyx_memoryview_type;
27467 : #endif
27468 : #if !CYTHON_USE_TYPE_SPECS
27469 1 : if (__Pyx_PyType_Ready(__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
27470 : #endif
27471 : #if PY_MAJOR_VERSION < 3
27472 : __pyx_memoryviewslice_type->tp_print = 0;
27473 : #endif
27474 : #if !CYTHON_COMPILING_IN_LIMITED_API
27475 1 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryviewslice_type->tp_dictoffset && __pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
27476 1 : __pyx_memoryviewslice_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
27477 : }
27478 : #endif
27479 1 : if (__Pyx_SetVtable(__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
27480 : #if !CYTHON_COMPILING_IN_LIMITED_API
27481 1 : if (__Pyx_MergeVtables(__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
27482 : #endif
27483 : #if !CYTHON_COMPILING_IN_LIMITED_API
27484 1 : if (__Pyx_setup_reduce((PyObject *) __pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
27485 : #endif
27486 : __Pyx_RefNannyFinishContext();
27487 : return 0;
27488 0 : __pyx_L1_error:;
27489 0 : __Pyx_XDECREF(__pyx_t_1);
27490 0 : __Pyx_RefNannyFinishContext();
27491 0 : return -1;
27492 : }
27493 :
27494 1 : static int __Pyx_modinit_type_import_code(void) {
27495 : __Pyx_RefNannyDeclarations
27496 1 : PyObject *__pyx_t_1 = NULL;
27497 1 : int __pyx_lineno = 0;
27498 1 : const char *__pyx_filename = NULL;
27499 1 : int __pyx_clineno = 0;
27500 1 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
27501 : /*--- Type import code ---*/
27502 1 : __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
27503 1 : __Pyx_GOTREF(__pyx_t_1);
27504 1 : __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
27505 : #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27506 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
27507 : #elif CYTHON_COMPILING_IN_LIMITED_API
27508 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
27509 : #else
27510 : sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject),
27511 : #endif
27512 1 : __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
27513 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27514 1 : __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 271, __pyx_L1_error)
27515 1 : __Pyx_GOTREF(__pyx_t_1);
27516 1 : __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 271, __pyx_L1_error)
27517 1 : __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 316, __pyx_L1_error)
27518 1 : __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 320, __pyx_L1_error)
27519 1 : __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 359, __pyx_L1_error)
27520 1 : __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
27521 1 : __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
27522 1 : __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
27523 1 : __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
27524 1 : __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
27525 1 : __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
27526 1 : __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
27527 1 : __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
27528 1 : __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
27529 1 : __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
27530 1 : __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 929, __pyx_L1_error)
27531 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27532 : __Pyx_RefNannyFinishContext();
27533 : return 0;
27534 0 : __pyx_L1_error:;
27535 0 : __Pyx_XDECREF(__pyx_t_1);
27536 0 : __Pyx_RefNannyFinishContext();
27537 0 : return -1;
27538 : }
27539 :
27540 : static int __Pyx_modinit_variable_import_code(void) {
27541 : __Pyx_RefNannyDeclarations
27542 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
27543 : /*--- Variable import code ---*/
27544 : __Pyx_RefNannyFinishContext();
27545 : return 0;
27546 : }
27547 :
27548 : static int __Pyx_modinit_function_import_code(void) {
27549 : __Pyx_RefNannyDeclarations
27550 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
27551 : /*--- Function import code ---*/
27552 : __Pyx_RefNannyFinishContext();
27553 : return 0;
27554 : }
27555 :
27556 :
27557 : #if PY_MAJOR_VERSION >= 3
27558 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27559 : static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
27560 : static int __pyx_pymod_exec__matching(PyObject* module); /*proto*/
27561 : static PyModuleDef_Slot __pyx_moduledef_slots[] = {
27562 : {Py_mod_create, (void*)__pyx_pymod_create},
27563 : {Py_mod_exec, (void*)__pyx_pymod_exec__matching},
27564 : {0, NULL}
27565 : };
27566 : #endif
27567 :
27568 : #ifdef __cplusplus
27569 : namespace {
27570 : struct PyModuleDef __pyx_moduledef =
27571 : #else
27572 : static struct PyModuleDef __pyx_moduledef =
27573 : #endif
27574 : {
27575 : PyModuleDef_HEAD_INIT,
27576 : "_matching",
27577 : 0, /* m_doc */
27578 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27579 : 0, /* m_size */
27580 : #elif CYTHON_USE_MODULE_STATE
27581 : sizeof(__pyx_mstate), /* m_size */
27582 : #else
27583 : -1, /* m_size */
27584 : #endif
27585 : __pyx_methods /* m_methods */,
27586 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27587 : __pyx_moduledef_slots, /* m_slots */
27588 : #else
27589 : NULL, /* m_reload */
27590 : #endif
27591 : #if CYTHON_USE_MODULE_STATE
27592 : __pyx_m_traverse, /* m_traverse */
27593 : __pyx_m_clear, /* m_clear */
27594 : NULL /* m_free */
27595 : #else
27596 : NULL, /* m_traverse */
27597 : NULL, /* m_clear */
27598 : NULL /* m_free */
27599 : #endif
27600 : };
27601 : #ifdef __cplusplus
27602 : } /* anonymous namespace */
27603 : #endif
27604 : #endif
27605 :
27606 : #ifndef CYTHON_NO_PYINIT_EXPORT
27607 : #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
27608 : #elif PY_MAJOR_VERSION < 3
27609 : #ifdef __cplusplus
27610 : #define __Pyx_PyMODINIT_FUNC extern "C" void
27611 : #else
27612 : #define __Pyx_PyMODINIT_FUNC void
27613 : #endif
27614 : #else
27615 : #ifdef __cplusplus
27616 : #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
27617 : #else
27618 : #define __Pyx_PyMODINIT_FUNC PyObject *
27619 : #endif
27620 : #endif
27621 :
27622 :
27623 : #if PY_MAJOR_VERSION < 3
27624 : __Pyx_PyMODINIT_FUNC init_matching(void) CYTHON_SMALL_CODE; /*proto*/
27625 : __Pyx_PyMODINIT_FUNC init_matching(void)
27626 : #else
27627 : __Pyx_PyMODINIT_FUNC PyInit__matching(void) CYTHON_SMALL_CODE; /*proto*/
27628 1 : __Pyx_PyMODINIT_FUNC PyInit__matching(void)
27629 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27630 : {
27631 1 : return PyModuleDef_Init(&__pyx_moduledef);
27632 : }
27633 1 : static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
27634 : #if PY_VERSION_HEX >= 0x030700A1
27635 1 : static PY_INT64_T main_interpreter_id = -1;
27636 1 : PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
27637 1 : if (main_interpreter_id == -1) {
27638 1 : main_interpreter_id = current_id;
27639 2 : return (unlikely(current_id == -1)) ? -1 : 0;
27640 0 : } else if (unlikely(main_interpreter_id != current_id))
27641 : #else
27642 : static PyInterpreterState *main_interpreter = NULL;
27643 : PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
27644 : if (!main_interpreter) {
27645 : main_interpreter = current_interpreter;
27646 : } else if (unlikely(main_interpreter != current_interpreter))
27647 : #endif
27648 : {
27649 0 : PyErr_SetString(
27650 : PyExc_ImportError,
27651 : "Interpreter change detected - this module can only be loaded into one interpreter per process.");
27652 0 : return -1;
27653 : }
27654 : return 0;
27655 : }
27656 : #if CYTHON_COMPILING_IN_LIMITED_API
27657 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
27658 : #else
27659 4 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
27660 : #endif
27661 : {
27662 4 : PyObject *value = PyObject_GetAttrString(spec, from_name);
27663 4 : int result = 0;
27664 4 : if (likely(value)) {
27665 4 : if (allow_none || value != Py_None) {
27666 : #if CYTHON_COMPILING_IN_LIMITED_API
27667 : result = PyModule_AddObject(module, to_name, value);
27668 : #else
27669 3 : result = PyDict_SetItemString(moddict, to_name, value);
27670 : #endif
27671 : }
27672 4 : Py_DECREF(value);
27673 0 : } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
27674 0 : PyErr_Clear();
27675 : } else {
27676 : result = -1;
27677 : }
27678 4 : return result;
27679 : }
27680 1 : static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
27681 1 : PyObject *module = NULL, *moddict, *modname;
27682 1 : CYTHON_UNUSED_VAR(def);
27683 1 : if (__Pyx_check_single_interpreter())
27684 : return NULL;
27685 1 : if (__pyx_m)
27686 0 : return __Pyx_NewRef(__pyx_m);
27687 1 : modname = PyObject_GetAttrString(spec, "name");
27688 1 : if (unlikely(!modname)) goto bad;
27689 1 : module = PyModule_NewObject(modname);
27690 1 : Py_DECREF(modname);
27691 1 : if (unlikely(!module)) goto bad;
27692 : #if CYTHON_COMPILING_IN_LIMITED_API
27693 : moddict = module;
27694 : #else
27695 1 : moddict = PyModule_GetDict(module);
27696 1 : if (unlikely(!moddict)) goto bad;
27697 : #endif
27698 1 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
27699 1 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
27700 1 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
27701 1 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
27702 : return module;
27703 0 : bad:
27704 0 : Py_XDECREF(module);
27705 0 : return NULL;
27706 : }
27707 :
27708 :
27709 1 : static CYTHON_SMALL_CODE int __pyx_pymod_exec__matching(PyObject *__pyx_pyinit_module)
27710 : #endif
27711 : #endif
27712 : {
27713 1 : int stringtab_initialized = 0;
27714 : #if CYTHON_USE_MODULE_STATE
27715 : int pystate_addmodule_run = 0;
27716 : #endif
27717 1 : PyObject *__pyx_t_1 = NULL;
27718 1 : PyObject *__pyx_t_2 = NULL;
27719 1 : PyObject *__pyx_t_3 = NULL;
27720 1 : PyObject *__pyx_t_4 = NULL;
27721 1 : PyObject *__pyx_t_5 = NULL;
27722 1 : int __pyx_t_6;
27723 1 : PyObject *__pyx_t_7 = NULL;
27724 1 : static PyThread_type_lock __pyx_t_8[8];
27725 1 : int __pyx_t_9;
27726 1 : int __pyx_lineno = 0;
27727 1 : const char *__pyx_filename = NULL;
27728 1 : int __pyx_clineno = 0;
27729 : __Pyx_RefNannyDeclarations
27730 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27731 1 : if (__pyx_m) {
27732 0 : if (__pyx_m == __pyx_pyinit_module) return 0;
27733 0 : PyErr_SetString(PyExc_RuntimeError, "Module '_matching' has already been imported. Re-initialisation is not supported.");
27734 0 : return -1;
27735 : }
27736 : #elif PY_MAJOR_VERSION >= 3
27737 : if (__pyx_m) return __Pyx_NewRef(__pyx_m);
27738 : #endif
27739 : /*--- Module creation code ---*/
27740 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27741 1 : __pyx_m = __pyx_pyinit_module;
27742 1 : Py_INCREF(__pyx_m);
27743 : #else
27744 : #if PY_MAJOR_VERSION < 3
27745 : __pyx_m = Py_InitModule4("_matching", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
27746 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
27747 : #elif CYTHON_USE_MODULE_STATE
27748 : __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27749 : {
27750 : int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
27751 : __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_matching" pseudovariable */
27752 : if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27753 : pystate_addmodule_run = 1;
27754 : }
27755 : #else
27756 : __pyx_m = PyModule_Create(&__pyx_moduledef);
27757 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
27758 : #endif
27759 : #endif
27760 1 : CYTHON_UNUSED_VAR(__pyx_t_1);
27761 1 : __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
27762 1 : Py_INCREF(__pyx_d);
27763 1 : __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
27764 1 : __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
27765 1 : if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27766 : #if CYTHON_REFNANNY
27767 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
27768 : if (!__Pyx_RefNanny) {
27769 : PyErr_Clear();
27770 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
27771 : if (!__Pyx_RefNanny)
27772 : Py_FatalError("failed to import 'refnanny' module");
27773 : }
27774 : #endif
27775 1 : __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__matching(void)", 0);
27776 1 : if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27777 : #ifdef __Pxy_PyFrame_Initialize_Offsets
27778 : __Pxy_PyFrame_Initialize_Offsets();
27779 : #endif
27780 1 : __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
27781 1 : __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
27782 1 : __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
27783 : #ifdef __Pyx_CyFunction_USED
27784 1 : if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27785 : #endif
27786 : #ifdef __Pyx_FusedFunction_USED
27787 : if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27788 : #endif
27789 : #ifdef __Pyx_Coroutine_USED
27790 : if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27791 : #endif
27792 : #ifdef __Pyx_Generator_USED
27793 : if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27794 : #endif
27795 : #ifdef __Pyx_AsyncGen_USED
27796 : if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27797 : #endif
27798 : #ifdef __Pyx_StopAsyncIteration_USED
27799 : if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27800 : #endif
27801 : /*--- Library function declarations ---*/
27802 : /*--- Threads initialization code ---*/
27803 : #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
27804 : PyEval_InitThreads();
27805 : #endif
27806 : /*--- Initialize various global constants etc. ---*/
27807 1 : if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27808 1 : stringtab_initialized = 1;
27809 1 : if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27810 : #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
27811 : if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27812 : #endif
27813 1 : if (__pyx_module_is_main_scipy__sparse__csgraph___matching) {
27814 0 : if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27815 : }
27816 : #if PY_MAJOR_VERSION >= 3
27817 : {
27818 1 : PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
27819 1 : if (!PyDict_GetItemString(modules, "scipy.sparse.csgraph._matching")) {
27820 0 : if (unlikely((PyDict_SetItemString(modules, "scipy.sparse.csgraph._matching", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27821 : }
27822 : }
27823 : #endif
27824 : /*--- Builtin init code ---*/
27825 1 : if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27826 : /*--- Constants init code ---*/
27827 1 : if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27828 : /*--- Global type/function init code ---*/
27829 1 : (void)__Pyx_modinit_global_init_code();
27830 1 : (void)__Pyx_modinit_variable_export_code();
27831 1 : (void)__Pyx_modinit_function_export_code();
27832 1 : if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27833 1 : if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27834 1 : (void)__Pyx_modinit_variable_import_code();
27835 1 : (void)__Pyx_modinit_function_import_code();
27836 : /*--- Execution code ---*/
27837 : #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
27838 : if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27839 : #endif
27840 :
27841 : /* "View.MemoryView":99
27842 : *
27843 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27844 : * try: # <<<<<<<<<<<<<<
27845 : * if __import__("sys").version_info >= (3, 3):
27846 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27847 : */
27848 : {
27849 1 : __Pyx_PyThreadState_declare
27850 1 : __Pyx_PyThreadState_assign
27851 1 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
27852 1 : __Pyx_XGOTREF(__pyx_t_1);
27853 1 : __Pyx_XGOTREF(__pyx_t_2);
27854 1 : __Pyx_XGOTREF(__pyx_t_3);
27855 : /*try:*/ {
27856 :
27857 : /* "View.MemoryView":100
27858 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27859 : * try:
27860 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
27861 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27862 : * else:
27863 : */
27864 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L2_error)
27865 1 : __Pyx_GOTREF(__pyx_t_4);
27866 1 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 100, __pyx_L2_error)
27867 1 : __Pyx_GOTREF(__pyx_t_5);
27868 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27869 1 : __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_tuple__15, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L2_error)
27870 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27871 1 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 100, __pyx_L2_error)
27872 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27873 1 : if (__pyx_t_6) {
27874 :
27875 : /* "View.MemoryView":101
27876 : * try:
27877 : * if __import__("sys").version_info >= (3, 3):
27878 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
27879 : * else:
27880 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
27881 : */
27882 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
27883 1 : __Pyx_GOTREF(__pyx_t_4);
27884 1 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 101, __pyx_L2_error)
27885 1 : __Pyx_GOTREF(__pyx_t_5);
27886 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27887 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
27888 1 : __Pyx_GOTREF(__pyx_t_4);
27889 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27890 1 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27891 1 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
27892 1 : __Pyx_GIVEREF(__pyx_t_4);
27893 1 : __pyx_t_4 = 0;
27894 :
27895 : /* "View.MemoryView":100
27896 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27897 : * try:
27898 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
27899 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27900 : * else:
27901 : */
27902 1 : goto __pyx_L8;
27903 : }
27904 :
27905 : /* "View.MemoryView":103
27906 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27907 : * else:
27908 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<<
27909 : * except:
27910 : *
27911 : */
27912 : /*else*/ {
27913 0 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 103, __pyx_L2_error)
27914 0 : __Pyx_GOTREF(__pyx_t_4);
27915 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 103, __pyx_L2_error)
27916 0 : __Pyx_GOTREF(__pyx_t_5);
27917 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27918 0 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27919 0 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_5);
27920 0 : __Pyx_GIVEREF(__pyx_t_5);
27921 0 : __pyx_t_5 = 0;
27922 : }
27923 1 : __pyx_L8:;
27924 :
27925 : /* "View.MemoryView":99
27926 : *
27927 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27928 : * try: # <<<<<<<<<<<<<<
27929 : * if __import__("sys").version_info >= (3, 3):
27930 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27931 : */
27932 : }
27933 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27934 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27935 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27936 1 : goto __pyx_L7_try_end;
27937 0 : __pyx_L2_error:;
27938 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27939 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27940 :
27941 : /* "View.MemoryView":104
27942 : * else:
27943 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
27944 : * except: # <<<<<<<<<<<<<<
27945 : *
27946 : * __pyx_collections_abc_Sequence = None
27947 : */
27948 : /*except:*/ {
27949 0 : __Pyx_AddTraceback("View.MemoryView", __pyx_clineno, __pyx_lineno, __pyx_filename);
27950 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(1, 104, __pyx_L4_except_error)
27951 0 : __Pyx_XGOTREF(__pyx_t_5);
27952 0 : __Pyx_XGOTREF(__pyx_t_4);
27953 0 : __Pyx_XGOTREF(__pyx_t_7);
27954 :
27955 : /* "View.MemoryView":106
27956 : * except:
27957 : *
27958 : * __pyx_collections_abc_Sequence = None # <<<<<<<<<<<<<<
27959 : *
27960 : *
27961 : */
27962 0 : __Pyx_INCREF(Py_None);
27963 0 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27964 0 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
27965 0 : __Pyx_GIVEREF(Py_None);
27966 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27967 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27968 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27969 0 : goto __pyx_L3_exception_handled;
27970 : }
27971 :
27972 : /* "View.MemoryView":99
27973 : *
27974 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27975 : * try: # <<<<<<<<<<<<<<
27976 : * if __import__("sys").version_info >= (3, 3):
27977 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27978 : */
27979 0 : __pyx_L4_except_error:;
27980 0 : __Pyx_XGIVEREF(__pyx_t_1);
27981 0 : __Pyx_XGIVEREF(__pyx_t_2);
27982 0 : __Pyx_XGIVEREF(__pyx_t_3);
27983 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27984 0 : goto __pyx_L1_error;
27985 0 : __pyx_L3_exception_handled:;
27986 0 : __Pyx_XGIVEREF(__pyx_t_1);
27987 0 : __Pyx_XGIVEREF(__pyx_t_2);
27988 0 : __Pyx_XGIVEREF(__pyx_t_3);
27989 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27990 1 : __pyx_L7_try_end:;
27991 : }
27992 :
27993 : /* "View.MemoryView":241
27994 : *
27995 : *
27996 : * try: # <<<<<<<<<<<<<<
27997 : * count = __pyx_collections_abc_Sequence.count
27998 : * index = __pyx_collections_abc_Sequence.index
27999 : */
28000 : {
28001 1 : __Pyx_PyThreadState_declare
28002 1 : __Pyx_PyThreadState_assign
28003 1 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
28004 1 : __Pyx_XGOTREF(__pyx_t_3);
28005 1 : __Pyx_XGOTREF(__pyx_t_2);
28006 1 : __Pyx_XGOTREF(__pyx_t_1);
28007 : /*try:*/ {
28008 :
28009 : /* "View.MemoryView":242
28010 : *
28011 : * try:
28012 : * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
28013 : * index = __pyx_collections_abc_Sequence.index
28014 : * except:
28015 : */
28016 1 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 242, __pyx_L11_error)
28017 1 : __Pyx_GOTREF(__pyx_t_7);
28018 1 : if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(1, 242, __pyx_L11_error)
28019 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28020 1 : PyType_Modified(__pyx_array_type);
28021 :
28022 : /* "View.MemoryView":243
28023 : * try:
28024 : * count = __pyx_collections_abc_Sequence.count
28025 : * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
28026 : * except:
28027 : * pass
28028 : */
28029 1 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 243, __pyx_L11_error)
28030 1 : __Pyx_GOTREF(__pyx_t_7);
28031 1 : if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(1, 243, __pyx_L11_error)
28032 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28033 1 : PyType_Modified(__pyx_array_type);
28034 :
28035 : /* "View.MemoryView":241
28036 : *
28037 : *
28038 : * try: # <<<<<<<<<<<<<<
28039 : * count = __pyx_collections_abc_Sequence.count
28040 : * index = __pyx_collections_abc_Sequence.index
28041 : */
28042 : }
28043 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28044 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28045 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28046 1 : goto __pyx_L16_try_end;
28047 0 : __pyx_L11_error:;
28048 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28049 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28050 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
28051 :
28052 : /* "View.MemoryView":244
28053 : * count = __pyx_collections_abc_Sequence.count
28054 : * index = __pyx_collections_abc_Sequence.index
28055 : * except: # <<<<<<<<<<<<<<
28056 : * pass
28057 : *
28058 : */
28059 : /*except:*/ {
28060 0 : __Pyx_ErrRestore(0,0,0);
28061 0 : goto __pyx_L12_exception_handled;
28062 : }
28063 0 : __pyx_L12_exception_handled:;
28064 0 : __Pyx_XGIVEREF(__pyx_t_3);
28065 0 : __Pyx_XGIVEREF(__pyx_t_2);
28066 0 : __Pyx_XGIVEREF(__pyx_t_1);
28067 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
28068 1 : __pyx_L16_try_end:;
28069 : }
28070 :
28071 : /* "View.MemoryView":309
28072 : * return self.name
28073 : *
28074 : * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
28075 : * cdef strided = Enum("<strided and direct>") # default
28076 : * cdef indirect = Enum("<strided and indirect>")
28077 : */
28078 1 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 309, __pyx_L1_error)
28079 1 : __Pyx_GOTREF(__pyx_t_7);
28080 1 : __Pyx_XGOTREF(generic);
28081 1 : __Pyx_DECREF_SET(generic, __pyx_t_7);
28082 1 : __Pyx_GIVEREF(__pyx_t_7);
28083 1 : __pyx_t_7 = 0;
28084 :
28085 : /* "View.MemoryView":310
28086 : *
28087 : * cdef generic = Enum("<strided and direct or indirect>")
28088 : * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
28089 : * cdef indirect = Enum("<strided and indirect>")
28090 : *
28091 : */
28092 1 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 310, __pyx_L1_error)
28093 1 : __Pyx_GOTREF(__pyx_t_7);
28094 1 : __Pyx_XGOTREF(strided);
28095 1 : __Pyx_DECREF_SET(strided, __pyx_t_7);
28096 1 : __Pyx_GIVEREF(__pyx_t_7);
28097 1 : __pyx_t_7 = 0;
28098 :
28099 : /* "View.MemoryView":311
28100 : * cdef generic = Enum("<strided and direct or indirect>")
28101 : * cdef strided = Enum("<strided and direct>") # default
28102 : * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
28103 : *
28104 : *
28105 : */
28106 1 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 311, __pyx_L1_error)
28107 1 : __Pyx_GOTREF(__pyx_t_7);
28108 1 : __Pyx_XGOTREF(indirect);
28109 1 : __Pyx_DECREF_SET(indirect, __pyx_t_7);
28110 1 : __Pyx_GIVEREF(__pyx_t_7);
28111 1 : __pyx_t_7 = 0;
28112 :
28113 : /* "View.MemoryView":314
28114 : *
28115 : *
28116 : * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
28117 : * cdef indirect_contiguous = Enum("<contiguous and indirect>")
28118 : *
28119 : */
28120 1 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 314, __pyx_L1_error)
28121 1 : __Pyx_GOTREF(__pyx_t_7);
28122 1 : __Pyx_XGOTREF(contiguous);
28123 1 : __Pyx_DECREF_SET(contiguous, __pyx_t_7);
28124 1 : __Pyx_GIVEREF(__pyx_t_7);
28125 1 : __pyx_t_7 = 0;
28126 :
28127 : /* "View.MemoryView":315
28128 : *
28129 : * cdef contiguous = Enum("<contiguous and direct>")
28130 : * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
28131 : *
28132 : *
28133 : */
28134 1 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 315, __pyx_L1_error)
28135 1 : __Pyx_GOTREF(__pyx_t_7);
28136 1 : __Pyx_XGOTREF(indirect_contiguous);
28137 1 : __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_7);
28138 1 : __Pyx_GIVEREF(__pyx_t_7);
28139 1 : __pyx_t_7 = 0;
28140 :
28141 : /* "View.MemoryView":323
28142 : *
28143 : *
28144 : * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
28145 : * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
28146 : * PyThread_allocate_lock(),
28147 : */
28148 1 : __pyx_memoryview_thread_locks_used = 0;
28149 :
28150 : /* "View.MemoryView":324
28151 : *
28152 : * cdef int __pyx_memoryview_thread_locks_used = 0
28153 : * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
28154 : * PyThread_allocate_lock(),
28155 : * PyThread_allocate_lock(),
28156 : */
28157 1 : __pyx_t_8[0] = PyThread_allocate_lock();
28158 1 : __pyx_t_8[1] = PyThread_allocate_lock();
28159 1 : __pyx_t_8[2] = PyThread_allocate_lock();
28160 1 : __pyx_t_8[3] = PyThread_allocate_lock();
28161 1 : __pyx_t_8[4] = PyThread_allocate_lock();
28162 1 : __pyx_t_8[5] = PyThread_allocate_lock();
28163 1 : __pyx_t_8[6] = PyThread_allocate_lock();
28164 1 : __pyx_t_8[7] = PyThread_allocate_lock();
28165 1 : memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_8, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
28166 :
28167 : /* "View.MemoryView":982
28168 : *
28169 : *
28170 : * try: # <<<<<<<<<<<<<<
28171 : * count = __pyx_collections_abc_Sequence.count
28172 : * index = __pyx_collections_abc_Sequence.index
28173 : */
28174 : {
28175 1 : __Pyx_PyThreadState_declare
28176 1 : __Pyx_PyThreadState_assign
28177 1 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
28178 1 : __Pyx_XGOTREF(__pyx_t_1);
28179 1 : __Pyx_XGOTREF(__pyx_t_2);
28180 1 : __Pyx_XGOTREF(__pyx_t_3);
28181 : /*try:*/ {
28182 :
28183 : /* "View.MemoryView":983
28184 : *
28185 : * try:
28186 : * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
28187 : * index = __pyx_collections_abc_Sequence.index
28188 : * except:
28189 : */
28190 1 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 983, __pyx_L17_error)
28191 1 : __Pyx_GOTREF(__pyx_t_7);
28192 1 : if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(1, 983, __pyx_L17_error)
28193 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28194 1 : PyType_Modified(__pyx_memoryviewslice_type);
28195 :
28196 : /* "View.MemoryView":984
28197 : * try:
28198 : * count = __pyx_collections_abc_Sequence.count
28199 : * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
28200 : * except:
28201 : * pass
28202 : */
28203 1 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 984, __pyx_L17_error)
28204 1 : __Pyx_GOTREF(__pyx_t_7);
28205 1 : if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(1, 984, __pyx_L17_error)
28206 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28207 1 : PyType_Modified(__pyx_memoryviewslice_type);
28208 :
28209 : /* "View.MemoryView":982
28210 : *
28211 : *
28212 : * try: # <<<<<<<<<<<<<<
28213 : * count = __pyx_collections_abc_Sequence.count
28214 : * index = __pyx_collections_abc_Sequence.index
28215 : */
28216 : }
28217 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28218 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28219 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28220 1 : goto __pyx_L22_try_end;
28221 0 : __pyx_L17_error:;
28222 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28223 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28224 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
28225 :
28226 : /* "View.MemoryView":985
28227 : * count = __pyx_collections_abc_Sequence.count
28228 : * index = __pyx_collections_abc_Sequence.index
28229 : * except: # <<<<<<<<<<<<<<
28230 : * pass
28231 : *
28232 : */
28233 : /*except:*/ {
28234 0 : __Pyx_ErrRestore(0,0,0);
28235 0 : goto __pyx_L18_exception_handled;
28236 : }
28237 0 : __pyx_L18_exception_handled:;
28238 0 : __Pyx_XGIVEREF(__pyx_t_1);
28239 0 : __Pyx_XGIVEREF(__pyx_t_2);
28240 0 : __Pyx_XGIVEREF(__pyx_t_3);
28241 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
28242 1 : __pyx_L22_try_end:;
28243 : }
28244 :
28245 : /* "View.MemoryView":988
28246 : * pass
28247 : *
28248 : * try: # <<<<<<<<<<<<<<
28249 : * if __pyx_collections_abc_Sequence:
28250 : *
28251 : */
28252 : {
28253 1 : __Pyx_PyThreadState_declare
28254 1 : __Pyx_PyThreadState_assign
28255 1 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
28256 1 : __Pyx_XGOTREF(__pyx_t_3);
28257 1 : __Pyx_XGOTREF(__pyx_t_2);
28258 1 : __Pyx_XGOTREF(__pyx_t_1);
28259 : /*try:*/ {
28260 :
28261 : /* "View.MemoryView":989
28262 : *
28263 : * try:
28264 : * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
28265 : *
28266 : *
28267 : */
28268 1 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 989, __pyx_L23_error)
28269 1 : if (__pyx_t_6) {
28270 :
28271 : /* "View.MemoryView":993
28272 : *
28273 : *
28274 : * __pyx_collections_abc_Sequence.register(_memoryviewslice) # <<<<<<<<<<<<<<
28275 : * __pyx_collections_abc_Sequence.register(array)
28276 : * except:
28277 : */
28278 1 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 993, __pyx_L23_error)
28279 1 : __Pyx_GOTREF(__pyx_t_7);
28280 1 : __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_memoryviewslice_type)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 993, __pyx_L23_error)
28281 1 : __Pyx_GOTREF(__pyx_t_4);
28282 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28283 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28284 :
28285 : /* "View.MemoryView":994
28286 : *
28287 : * __pyx_collections_abc_Sequence.register(_memoryviewslice)
28288 : * __pyx_collections_abc_Sequence.register(array) # <<<<<<<<<<<<<<
28289 : * except:
28290 : * pass # ignore failure, it's a minor issue
28291 : */
28292 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 994, __pyx_L23_error)
28293 1 : __Pyx_GOTREF(__pyx_t_4);
28294 1 : __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_array_type)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 994, __pyx_L23_error)
28295 1 : __Pyx_GOTREF(__pyx_t_7);
28296 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28297 2 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28298 :
28299 : /* "View.MemoryView":989
28300 : *
28301 : * try:
28302 : * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
28303 : *
28304 : *
28305 : */
28306 : }
28307 :
28308 : /* "View.MemoryView":988
28309 : * pass
28310 : *
28311 : * try: # <<<<<<<<<<<<<<
28312 : * if __pyx_collections_abc_Sequence:
28313 : *
28314 : */
28315 : }
28316 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28317 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28318 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28319 1 : goto __pyx_L28_try_end;
28320 0 : __pyx_L23_error:;
28321 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28322 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28323 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
28324 :
28325 : /* "View.MemoryView":995
28326 : * __pyx_collections_abc_Sequence.register(_memoryviewslice)
28327 : * __pyx_collections_abc_Sequence.register(array)
28328 : * except: # <<<<<<<<<<<<<<
28329 : * pass # ignore failure, it's a minor issue
28330 : *
28331 : */
28332 : /*except:*/ {
28333 0 : __Pyx_ErrRestore(0,0,0);
28334 0 : goto __pyx_L24_exception_handled;
28335 : }
28336 0 : __pyx_L24_exception_handled:;
28337 0 : __Pyx_XGIVEREF(__pyx_t_3);
28338 0 : __Pyx_XGIVEREF(__pyx_t_2);
28339 0 : __Pyx_XGIVEREF(__pyx_t_1);
28340 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
28341 1 : __pyx_L28_try_end:;
28342 : }
28343 :
28344 : /* "(tree fragment)":1
28345 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
28346 : * cdef object __pyx_PickleError
28347 : * cdef object __pyx_result
28348 : */
28349 1 : __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error)
28350 1 : __Pyx_GOTREF(__pyx_t_7);
28351 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
28352 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28353 :
28354 : /* "scipy/sparse/csgraph/_matching.pyx":1
28355 : * import warnings # <<<<<<<<<<<<<<
28356 : *
28357 : * cimport cython
28358 : */
28359 1 : __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_warnings, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error)
28360 1 : __Pyx_GOTREF(__pyx_t_7);
28361 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28362 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28363 :
28364 : /* "scipy/sparse/csgraph/_matching.pyx":4
28365 : *
28366 : * cimport cython
28367 : * import numpy as np # <<<<<<<<<<<<<<
28368 : * cimport numpy as np
28369 : * from libc.math cimport INFINITY
28370 : */
28371 1 : __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4, __pyx_L1_error)
28372 1 : __Pyx_GOTREF(__pyx_t_7);
28373 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_7) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
28374 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28375 :
28376 : /* "scipy/sparse/csgraph/_matching.pyx":9
28377 : *
28378 : *
28379 : * from scipy.sparse import issparse # <<<<<<<<<<<<<<
28380 : * from scipy.sparse._sputils import convert_pydata_sparse_to_scipy
28381 : *
28382 : */
28383 1 : __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 9, __pyx_L1_error)
28384 1 : __Pyx_GOTREF(__pyx_t_7);
28385 1 : __Pyx_INCREF(__pyx_n_s_issparse);
28386 1 : __Pyx_GIVEREF(__pyx_n_s_issparse);
28387 1 : if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_issparse)) __PYX_ERR(0, 9, __pyx_L1_error);
28388 1 : __pyx_t_4 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_7, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 9, __pyx_L1_error)
28389 1 : __Pyx_GOTREF(__pyx_t_4);
28390 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28391 1 : __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_issparse); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 9, __pyx_L1_error)
28392 1 : __Pyx_GOTREF(__pyx_t_7);
28393 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_7) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
28394 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28395 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28396 :
28397 : /* "scipy/sparse/csgraph/_matching.pyx":10
28398 : *
28399 : * from scipy.sparse import issparse
28400 : * from scipy.sparse._sputils import convert_pydata_sparse_to_scipy # <<<<<<<<<<<<<<
28401 : *
28402 : * np.import_array()
28403 : */
28404 1 : __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error)
28405 1 : __Pyx_GOTREF(__pyx_t_4);
28406 1 : __Pyx_INCREF(__pyx_n_s_convert_pydata_sparse_to_scipy);
28407 1 : __Pyx_GIVEREF(__pyx_n_s_convert_pydata_sparse_to_scipy);
28408 1 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_convert_pydata_sparse_to_scipy)) __PYX_ERR(0, 10, __pyx_L1_error);
28409 1 : __pyx_t_7 = __Pyx_Import(__pyx_n_s_scipy_sparse__sputils, __pyx_t_4, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 10, __pyx_L1_error)
28410 1 : __Pyx_GOTREF(__pyx_t_7);
28411 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28412 1 : __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_convert_pydata_sparse_to_scipy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error)
28413 1 : __Pyx_GOTREF(__pyx_t_4);
28414 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_pydata_sparse_to_scipy, __pyx_t_4) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
28415 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28416 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28417 :
28418 : /* "scipy/sparse/csgraph/_matching.pyx":12
28419 : * from scipy.sparse._sputils import convert_pydata_sparse_to_scipy
28420 : *
28421 : * np.import_array() # <<<<<<<<<<<<<<
28422 : *
28423 : * include "parameters.pxi"
28424 : */
28425 1 : __pyx_t_9 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 12, __pyx_L1_error)
28426 :
28427 : /* "../scipy/sparse/csgraph/parameters.pxi":2
28428 : *
28429 : * DTYPE = np.float64 # <<<<<<<<<<<<<<
28430 : * ctypedef np.float64_t DTYPE_t
28431 : *
28432 : */
28433 1 : __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2, __pyx_L1_error)
28434 1 : __Pyx_GOTREF(__pyx_t_7);
28435 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2, __pyx_L1_error)
28436 1 : __Pyx_GOTREF(__pyx_t_4);
28437 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28438 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_4) < 0) __PYX_ERR(4, 2, __pyx_L1_error)
28439 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28440 :
28441 : /* "../scipy/sparse/csgraph/parameters.pxi":5
28442 : * ctypedef np.float64_t DTYPE_t
28443 : *
28444 : * ITYPE = np.int32 # <<<<<<<<<<<<<<
28445 : * ctypedef np.int32_t ITYPE_t
28446 : *
28447 : */
28448 1 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error)
28449 1 : __Pyx_GOTREF(__pyx_t_4);
28450 1 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 5, __pyx_L1_error)
28451 1 : __Pyx_GOTREF(__pyx_t_7);
28452 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28453 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_ITYPE, __pyx_t_7) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
28454 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28455 :
28456 : /* "scipy/sparse/csgraph/_matching.pyx":17
28457 : *
28458 : *
28459 : * def maximum_bipartite_matching(graph, perm_type='row'): # <<<<<<<<<<<<<<
28460 : * r"""
28461 : * maximum_bipartite_matching(graph, perm_type='row')
28462 : */
28463 1 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6sparse_7csgraph_9_matching_1maximum_bipartite_matching, 0, __pyx_n_s_maximum_bipartite_matching, NULL, __pyx_n_s_scipy_sparse_csgraph__matching, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 17, __pyx_L1_error)
28464 1 : __Pyx_GOTREF(__pyx_t_7);
28465 2 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__27);
28466 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_maximum_bipartite_matching, __pyx_t_7) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
28467 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28468 :
28469 : /* "scipy/sparse/csgraph/_matching.pyx":288
28470 : *
28471 : *
28472 : * def min_weight_full_bipartite_matching(biadjacency_matrix, maximize=False): # <<<<<<<<<<<<<<
28473 : * r"""
28474 : * min_weight_full_bipartite_matching(biadjacency_matrix, maximize=False)
28475 : */
28476 1 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6sparse_7csgraph_9_matching_3min_weight_full_bipartite_matching, 0, __pyx_n_s_min_weight_full_bipartite_matchi, NULL, __pyx_n_s_scipy_sparse_csgraph__matching, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error)
28477 1 : __Pyx_GOTREF(__pyx_t_7);
28478 2 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__31);
28479 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_min_weight_full_bipartite_matchi, __pyx_t_7) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
28480 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28481 :
28482 : /* "scipy/sparse/csgraph/_matching.pyx":522
28483 : *
28484 : * # We will use uint8 to represent booleans to simplify arrays of booleans below.
28485 : * BTYPE = np.uint8 # <<<<<<<<<<<<<<
28486 : * ctypedef np.uint8_t BTYPE_t
28487 : *
28488 : */
28489 1 : __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 522, __pyx_L1_error)
28490 1 : __Pyx_GOTREF(__pyx_t_7);
28491 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error)
28492 1 : __Pyx_GOTREF(__pyx_t_4);
28493 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28494 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_BTYPE, __pyx_t_4) < 0) __PYX_ERR(0, 522, __pyx_L1_error)
28495 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28496 :
28497 : /* "scipy/sparse/csgraph/_matching.pyx":1
28498 : * import warnings # <<<<<<<<<<<<<<
28499 : *
28500 : * cimport cython
28501 : */
28502 1 : __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
28503 1 : __Pyx_GOTREF(__pyx_t_4);
28504 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_maximum_bipartite_matching_line, __pyx_kp_u_maximum_bipartite_matching_grap) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28505 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_min_weight_full_bipartite_matchi_2, __pyx_kp_u_min_weight_full_bipartite_match) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28506 1 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28507 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28508 :
28509 : /*--- Wrapped vars code ---*/
28510 :
28511 1 : goto __pyx_L0;
28512 0 : __pyx_L1_error:;
28513 0 : __Pyx_XDECREF(__pyx_t_4);
28514 0 : __Pyx_XDECREF(__pyx_t_5);
28515 0 : __Pyx_XDECREF(__pyx_t_7);
28516 0 : if (__pyx_m) {
28517 0 : if (__pyx_d && stringtab_initialized) {
28518 0 : __Pyx_AddTraceback("init scipy.sparse.csgraph._matching", __pyx_clineno, __pyx_lineno, __pyx_filename);
28519 : }
28520 : #if !CYTHON_USE_MODULE_STATE
28521 0 : Py_CLEAR(__pyx_m);
28522 : #else
28523 : Py_DECREF(__pyx_m);
28524 : if (pystate_addmodule_run) {
28525 : PyObject *tp, *value, *tb;
28526 : PyErr_Fetch(&tp, &value, &tb);
28527 : PyState_RemoveModule(&__pyx_moduledef);
28528 : PyErr_Restore(tp, value, tb);
28529 : }
28530 : #endif
28531 0 : } else if (!PyErr_Occurred()) {
28532 0 : PyErr_SetString(PyExc_ImportError, "init scipy.sparse.csgraph._matching");
28533 : }
28534 0 : __pyx_L0:;
28535 1 : __Pyx_RefNannyFinishContext();
28536 : #if CYTHON_PEP489_MULTI_PHASE_INIT
28537 1 : return (__pyx_m != NULL) ? 0 : -1;
28538 : #elif PY_MAJOR_VERSION >= 3
28539 : return __pyx_m;
28540 : #else
28541 : return;
28542 : #endif
28543 : }
28544 : /* #### Code section: cleanup_globals ### */
28545 : /* #### Code section: cleanup_module ### */
28546 : /* #### Code section: main_method ### */
28547 : /* #### Code section: utility_code_pragmas ### */
28548 : #ifdef _MSC_VER
28549 : #pragma warning( push )
28550 : /* Warning 4127: conditional expression is constant
28551 : * Cython uses constant conditional expressions to allow in inline functions to be optimized at
28552 : * compile-time, so this warning is not useful
28553 : */
28554 : #pragma warning( disable : 4127 )
28555 : #endif
28556 :
28557 :
28558 :
28559 : /* #### Code section: utility_code_def ### */
28560 :
28561 : /* --- Runtime support code --- */
28562 : /* Refnanny */
28563 : #if CYTHON_REFNANNY
28564 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
28565 : PyObject *m = NULL, *p = NULL;
28566 : void *r = NULL;
28567 : m = PyImport_ImportModule(modname);
28568 : if (!m) goto end;
28569 : p = PyObject_GetAttrString(m, "RefNannyAPI");
28570 : if (!p) goto end;
28571 : r = PyLong_AsVoidPtr(p);
28572 : end:
28573 : Py_XDECREF(p);
28574 : Py_XDECREF(m);
28575 : return (__Pyx_RefNannyAPIStruct *)r;
28576 : }
28577 : #endif
28578 :
28579 : /* PyErrExceptionMatches */
28580 : #if CYTHON_FAST_THREAD_STATE
28581 0 : static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
28582 0 : Py_ssize_t i, n;
28583 0 : n = PyTuple_GET_SIZE(tuple);
28584 : #if PY_MAJOR_VERSION >= 3
28585 0 : for (i=0; i<n; i++) {
28586 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
28587 : }
28588 : #endif
28589 0 : for (i=0; i<n; i++) {
28590 0 : if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
28591 : }
28592 : return 0;
28593 : }
28594 3 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
28595 3 : int result;
28596 3 : PyObject *exc_type;
28597 : #if PY_VERSION_HEX >= 0x030C00A6
28598 3 : PyObject *current_exception = tstate->current_exception;
28599 3 : if (unlikely(!current_exception)) return 0;
28600 3 : exc_type = (PyObject*) Py_TYPE(current_exception);
28601 3 : if (exc_type == err) return 1;
28602 : #else
28603 : exc_type = tstate->curexc_type;
28604 : if (exc_type == err) return 1;
28605 : if (unlikely(!exc_type)) return 0;
28606 : #endif
28607 : #if CYTHON_AVOID_BORROWED_REFS
28608 : Py_INCREF(exc_type);
28609 : #endif
28610 0 : if (unlikely(PyTuple_Check(err))) {
28611 0 : result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
28612 : } else {
28613 0 : result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
28614 : }
28615 : #if CYTHON_AVOID_BORROWED_REFS
28616 : Py_DECREF(exc_type);
28617 : #endif
28618 : return result;
28619 : }
28620 : #endif
28621 :
28622 : /* PyErrFetchRestore */
28623 : #if CYTHON_FAST_THREAD_STATE
28624 50 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
28625 : #if PY_VERSION_HEX >= 0x030C00A6
28626 50 : PyObject *tmp_value;
28627 50 : assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
28628 50 : if (value) {
28629 : #if CYTHON_COMPILING_IN_CPYTHON
28630 47 : if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
28631 : #endif
28632 0 : PyException_SetTraceback(value, tb);
28633 : }
28634 50 : tmp_value = tstate->current_exception;
28635 50 : tstate->current_exception = value;
28636 50 : Py_XDECREF(tmp_value);
28637 50 : Py_XDECREF(type);
28638 50 : Py_XDECREF(tb);
28639 : #else
28640 : PyObject *tmp_type, *tmp_value, *tmp_tb;
28641 : tmp_type = tstate->curexc_type;
28642 : tmp_value = tstate->curexc_value;
28643 : tmp_tb = tstate->curexc_traceback;
28644 : tstate->curexc_type = type;
28645 : tstate->curexc_value = value;
28646 : tstate->curexc_traceback = tb;
28647 : Py_XDECREF(tmp_type);
28648 : Py_XDECREF(tmp_value);
28649 : Py_XDECREF(tmp_tb);
28650 : #endif
28651 50 : }
28652 47 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28653 : #if PY_VERSION_HEX >= 0x030C00A6
28654 47 : PyObject* exc_value;
28655 47 : exc_value = tstate->current_exception;
28656 47 : tstate->current_exception = 0;
28657 47 : *value = exc_value;
28658 47 : *type = NULL;
28659 47 : *tb = NULL;
28660 47 : if (exc_value) {
28661 47 : *type = (PyObject*) Py_TYPE(exc_value);
28662 47 : Py_INCREF(*type);
28663 : #if CYTHON_COMPILING_IN_CPYTHON
28664 47 : *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
28665 47 : Py_XINCREF(*tb);
28666 : #else
28667 : *tb = PyException_GetTraceback(exc_value);
28668 : #endif
28669 : }
28670 : #else
28671 : *type = tstate->curexc_type;
28672 : *value = tstate->curexc_value;
28673 : *tb = tstate->curexc_traceback;
28674 : tstate->curexc_type = 0;
28675 : tstate->curexc_value = 0;
28676 : tstate->curexc_traceback = 0;
28677 : #endif
28678 47 : }
28679 : #endif
28680 :
28681 : /* PyObjectGetAttrStr */
28682 : #if CYTHON_USE_TYPE_SLOTS
28683 4449 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
28684 4449 : PyTypeObject* tp = Py_TYPE(obj);
28685 4449 : if (likely(tp->tp_getattro))
28686 4449 : return tp->tp_getattro(obj, attr_name);
28687 : #if PY_MAJOR_VERSION < 3
28688 : if (likely(tp->tp_getattr))
28689 : return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
28690 : #endif
28691 0 : return PyObject_GetAttr(obj, attr_name);
28692 : }
28693 : #endif
28694 :
28695 : /* PyObjectGetAttrStrNoError */
28696 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
28697 3 : static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
28698 3 : __Pyx_PyThreadState_declare
28699 3 : __Pyx_PyThreadState_assign
28700 3 : if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
28701 3 : __Pyx_PyErr_Clear();
28702 3 : }
28703 : #endif
28704 29 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
28705 29 : PyObject *result;
28706 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
28707 : (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
28708 : return result;
28709 : #else
28710 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
28711 29 : PyTypeObject* tp = Py_TYPE(obj);
28712 29 : if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
28713 4 : return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
28714 : }
28715 : #endif
28716 25 : result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
28717 25 : if (unlikely(!result)) {
28718 3 : __Pyx_PyObject_GetAttrStr_ClearAttributeError();
28719 : }
28720 : return result;
28721 : #endif
28722 : }
28723 :
28724 : /* GetBuiltinName */
28725 11 : static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
28726 11 : PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
28727 11 : if (unlikely(!result) && !PyErr_Occurred()) {
28728 0 : PyErr_Format(PyExc_NameError,
28729 : #if PY_MAJOR_VERSION >= 3
28730 : "name '%U' is not defined", name);
28731 : #else
28732 : "name '%.200s' is not defined", PyString_AS_STRING(name));
28733 : #endif
28734 : }
28735 11 : return result;
28736 : }
28737 :
28738 : /* TupleAndListFromArray */
28739 : #if CYTHON_COMPILING_IN_CPYTHON
28740 : static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
28741 : PyObject *v;
28742 : Py_ssize_t i;
28743 : for (i = 0; i < length; i++) {
28744 : v = dest[i] = src[i];
28745 : Py_INCREF(v);
28746 : }
28747 : }
28748 : static CYTHON_INLINE PyObject *
28749 : __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
28750 : {
28751 : PyObject *res;
28752 : if (n <= 0) {
28753 : Py_INCREF(__pyx_empty_tuple);
28754 : return __pyx_empty_tuple;
28755 : }
28756 : res = PyTuple_New(n);
28757 : if (unlikely(res == NULL)) return NULL;
28758 : __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
28759 : return res;
28760 : }
28761 : static CYTHON_INLINE PyObject *
28762 : __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
28763 : {
28764 : PyObject *res;
28765 : if (n <= 0) {
28766 : return PyList_New(0);
28767 : }
28768 : res = PyList_New(n);
28769 : if (unlikely(res == NULL)) return NULL;
28770 : __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
28771 : return res;
28772 : }
28773 : #endif
28774 :
28775 : /* BytesEquals */
28776 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
28777 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
28778 : return PyObject_RichCompareBool(s1, s2, equals);
28779 : #else
28780 : if (s1 == s2) {
28781 : return (equals == Py_EQ);
28782 : } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
28783 : const char *ps1, *ps2;
28784 : Py_ssize_t length = PyBytes_GET_SIZE(s1);
28785 : if (length != PyBytes_GET_SIZE(s2))
28786 : return (equals == Py_NE);
28787 : ps1 = PyBytes_AS_STRING(s1);
28788 : ps2 = PyBytes_AS_STRING(s2);
28789 : if (ps1[0] != ps2[0]) {
28790 : return (equals == Py_NE);
28791 : } else if (length == 1) {
28792 : return (equals == Py_EQ);
28793 : } else {
28794 : int result;
28795 : #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
28796 : Py_hash_t hash1, hash2;
28797 : hash1 = ((PyBytesObject*)s1)->ob_shash;
28798 : hash2 = ((PyBytesObject*)s2)->ob_shash;
28799 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
28800 : return (equals == Py_NE);
28801 : }
28802 : #endif
28803 : result = memcmp(ps1, ps2, (size_t)length);
28804 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
28805 : }
28806 : } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
28807 : return (equals == Py_NE);
28808 : } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
28809 : return (equals == Py_NE);
28810 : } else {
28811 : int result;
28812 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
28813 : if (!py_result)
28814 : return -1;
28815 : result = __Pyx_PyObject_IsTrue(py_result);
28816 : Py_DECREF(py_result);
28817 : return result;
28818 : }
28819 : #endif
28820 : }
28821 :
28822 : /* UnicodeEquals */
28823 270 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
28824 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
28825 : return PyObject_RichCompareBool(s1, s2, equals);
28826 : #else
28827 : #if PY_MAJOR_VERSION < 3
28828 : PyObject* owned_ref = NULL;
28829 : #endif
28830 270 : int s1_is_unicode, s2_is_unicode;
28831 270 : if (s1 == s2) {
28832 254 : goto return_eq;
28833 : }
28834 16 : s1_is_unicode = PyUnicode_CheckExact(s1);
28835 16 : s2_is_unicode = PyUnicode_CheckExact(s2);
28836 : #if PY_MAJOR_VERSION < 3
28837 : if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
28838 : owned_ref = PyUnicode_FromObject(s2);
28839 : if (unlikely(!owned_ref))
28840 : return -1;
28841 : s2 = owned_ref;
28842 : s2_is_unicode = 1;
28843 : } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
28844 : owned_ref = PyUnicode_FromObject(s1);
28845 : if (unlikely(!owned_ref))
28846 : return -1;
28847 : s1 = owned_ref;
28848 : s1_is_unicode = 1;
28849 : } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
28850 : return __Pyx_PyBytes_Equals(s1, s2, equals);
28851 : }
28852 : #endif
28853 16 : if (s1_is_unicode & s2_is_unicode) {
28854 16 : Py_ssize_t length;
28855 16 : int kind;
28856 16 : void *data1, *data2;
28857 16 : if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
28858 : return -1;
28859 16 : length = __Pyx_PyUnicode_GET_LENGTH(s1);
28860 16 : if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
28861 14 : goto return_ne;
28862 : }
28863 : #if CYTHON_USE_UNICODE_INTERNALS
28864 : {
28865 2 : Py_hash_t hash1, hash2;
28866 : #if CYTHON_PEP393_ENABLED
28867 2 : hash1 = ((PyASCIIObject*)s1)->hash;
28868 2 : hash2 = ((PyASCIIObject*)s2)->hash;
28869 : #else
28870 : hash1 = ((PyUnicodeObject*)s1)->hash;
28871 : hash2 = ((PyUnicodeObject*)s2)->hash;
28872 : #endif
28873 2 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
28874 2 : goto return_ne;
28875 : }
28876 : }
28877 : #endif
28878 0 : kind = __Pyx_PyUnicode_KIND(s1);
28879 0 : if (kind != __Pyx_PyUnicode_KIND(s2)) {
28880 0 : goto return_ne;
28881 : }
28882 0 : data1 = __Pyx_PyUnicode_DATA(s1);
28883 0 : data2 = __Pyx_PyUnicode_DATA(s2);
28884 0 : if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
28885 0 : goto return_ne;
28886 0 : } else if (length == 1) {
28887 0 : goto return_eq;
28888 : } else {
28889 0 : int result = memcmp(data1, data2, (size_t)(length * kind));
28890 : #if PY_MAJOR_VERSION < 3
28891 : Py_XDECREF(owned_ref);
28892 : #endif
28893 0 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
28894 : }
28895 0 : } else if ((s1 == Py_None) & s2_is_unicode) {
28896 0 : goto return_ne;
28897 0 : } else if ((s2 == Py_None) & s1_is_unicode) {
28898 0 : goto return_ne;
28899 : } else {
28900 0 : int result;
28901 0 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
28902 : #if PY_MAJOR_VERSION < 3
28903 : Py_XDECREF(owned_ref);
28904 : #endif
28905 0 : if (!py_result)
28906 : return -1;
28907 0 : result = __Pyx_PyObject_IsTrue(py_result);
28908 0 : Py_DECREF(py_result);
28909 0 : return result;
28910 : }
28911 254 : return_eq:
28912 : #if PY_MAJOR_VERSION < 3
28913 : Py_XDECREF(owned_ref);
28914 : #endif
28915 254 : return (equals == Py_EQ);
28916 16 : return_ne:
28917 : #if PY_MAJOR_VERSION < 3
28918 : Py_XDECREF(owned_ref);
28919 : #endif
28920 16 : return (equals == Py_NE);
28921 : #endif
28922 : }
28923 :
28924 : /* fastcall */
28925 : #if CYTHON_METH_FASTCALL
28926 20 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
28927 : {
28928 20 : Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
28929 20 : for (i = 0; i < n; i++)
28930 : {
28931 20 : if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
28932 : }
28933 0 : for (i = 0; i < n; i++)
28934 : {
28935 0 : int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
28936 0 : if (unlikely(eq != 0)) {
28937 0 : if (unlikely(eq < 0)) return NULL;
28938 0 : return kwvalues[i];
28939 : }
28940 : }
28941 : return NULL;
28942 : }
28943 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
28944 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
28945 : Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
28946 : PyObject *dict;
28947 : dict = PyDict_New();
28948 : if (unlikely(!dict))
28949 : return NULL;
28950 : for (i=0; i<nkwargs; i++) {
28951 : PyObject *key = PyTuple_GET_ITEM(kwnames, i);
28952 : if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
28953 : goto bad;
28954 : }
28955 : return dict;
28956 : bad:
28957 : Py_DECREF(dict);
28958 : return NULL;
28959 : }
28960 : #endif
28961 : #endif
28962 :
28963 : /* RaiseArgTupleInvalid */
28964 0 : static void __Pyx_RaiseArgtupleInvalid(
28965 : const char* func_name,
28966 : int exact,
28967 : Py_ssize_t num_min,
28968 : Py_ssize_t num_max,
28969 : Py_ssize_t num_found)
28970 : {
28971 0 : Py_ssize_t num_expected;
28972 0 : const char *more_or_less;
28973 0 : if (num_found < num_min) {
28974 : num_expected = num_min;
28975 : more_or_less = "at least";
28976 : } else {
28977 0 : num_expected = num_max;
28978 0 : more_or_less = "at most";
28979 : }
28980 0 : if (exact) {
28981 0 : more_or_less = "exactly";
28982 : }
28983 0 : PyErr_Format(PyExc_TypeError,
28984 : "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
28985 : func_name, more_or_less, num_expected,
28986 : (num_expected == 1) ? "" : "s", num_found);
28987 0 : }
28988 :
28989 : /* RaiseDoubleKeywords */
28990 0 : static void __Pyx_RaiseDoubleKeywordsError(
28991 : const char* func_name,
28992 : PyObject* kw_name)
28993 : {
28994 0 : PyErr_Format(PyExc_TypeError,
28995 : #if PY_MAJOR_VERSION >= 3
28996 : "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
28997 : #else
28998 : "%s() got multiple values for keyword argument '%s'", func_name,
28999 : PyString_AsString(kw_name));
29000 : #endif
29001 : }
29002 :
29003 : /* ParseKeywords */
29004 0 : static int __Pyx_ParseOptionalKeywords(
29005 : PyObject *kwds,
29006 : PyObject *const *kwvalues,
29007 : PyObject **argnames[],
29008 : PyObject *kwds2,
29009 : PyObject *values[],
29010 : Py_ssize_t num_pos_args,
29011 : const char* function_name)
29012 : {
29013 0 : PyObject *key = 0, *value = 0;
29014 0 : Py_ssize_t pos = 0;
29015 0 : PyObject*** name;
29016 0 : PyObject*** first_kw_arg = argnames + num_pos_args;
29017 0 : int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
29018 0 : while (1) {
29019 0 : Py_XDECREF(key); key = NULL;
29020 0 : Py_XDECREF(value); value = NULL;
29021 0 : if (kwds_is_tuple) {
29022 0 : Py_ssize_t size;
29023 : #if CYTHON_ASSUME_SAFE_MACROS
29024 0 : size = PyTuple_GET_SIZE(kwds);
29025 : #else
29026 : size = PyTuple_Size(kwds);
29027 : if (size < 0) goto bad;
29028 : #endif
29029 0 : if (pos >= size) break;
29030 : #if CYTHON_AVOID_BORROWED_REFS
29031 : key = __Pyx_PySequence_ITEM(kwds, pos);
29032 : if (!key) goto bad;
29033 : #elif CYTHON_ASSUME_SAFE_MACROS
29034 0 : key = PyTuple_GET_ITEM(kwds, pos);
29035 : #else
29036 : key = PyTuple_GetItem(kwds, pos);
29037 : if (!key) goto bad;
29038 : #endif
29039 0 : value = kwvalues[pos];
29040 0 : pos++;
29041 : }
29042 : else
29043 : {
29044 0 : if (!PyDict_Next(kwds, &pos, &key, &value)) break;
29045 : #if CYTHON_AVOID_BORROWED_REFS
29046 : Py_INCREF(key);
29047 : #endif
29048 : }
29049 0 : name = first_kw_arg;
29050 0 : while (*name && (**name != key)) name++;
29051 0 : if (*name) {
29052 0 : values[name-argnames] = value;
29053 : #if CYTHON_AVOID_BORROWED_REFS
29054 : Py_INCREF(value);
29055 : Py_DECREF(key);
29056 : #endif
29057 0 : key = NULL;
29058 0 : value = NULL;
29059 0 : continue;
29060 : }
29061 : #if !CYTHON_AVOID_BORROWED_REFS
29062 0 : Py_INCREF(key);
29063 : #endif
29064 0 : Py_INCREF(value);
29065 0 : name = first_kw_arg;
29066 : #if PY_MAJOR_VERSION < 3
29067 : if (likely(PyString_Check(key))) {
29068 : while (*name) {
29069 : if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
29070 : && _PyString_Eq(**name, key)) {
29071 : values[name-argnames] = value;
29072 : #if CYTHON_AVOID_BORROWED_REFS
29073 : value = NULL;
29074 : #endif
29075 : break;
29076 : }
29077 : name++;
29078 : }
29079 : if (*name) continue;
29080 : else {
29081 : PyObject*** argname = argnames;
29082 : while (argname != first_kw_arg) {
29083 : if ((**argname == key) || (
29084 : (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
29085 : && _PyString_Eq(**argname, key))) {
29086 : goto arg_passed_twice;
29087 : }
29088 : argname++;
29089 : }
29090 : }
29091 : } else
29092 : #endif
29093 0 : if (likely(PyUnicode_Check(key))) {
29094 0 : while (*name) {
29095 0 : int cmp = (
29096 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
29097 0 : (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
29098 : #endif
29099 0 : PyUnicode_Compare(**name, key)
29100 : );
29101 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
29102 0 : if (cmp == 0) {
29103 0 : values[name-argnames] = value;
29104 : #if CYTHON_AVOID_BORROWED_REFS
29105 : value = NULL;
29106 : #endif
29107 0 : break;
29108 : }
29109 0 : name++;
29110 : }
29111 0 : if (*name) continue;
29112 : else {
29113 : PyObject*** argname = argnames;
29114 0 : while (argname != first_kw_arg) {
29115 0 : int cmp = (**argname == key) ? 0 :
29116 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
29117 0 : (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
29118 : #endif
29119 0 : PyUnicode_Compare(**argname, key);
29120 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
29121 0 : if (cmp == 0) goto arg_passed_twice;
29122 0 : argname++;
29123 : }
29124 : }
29125 : } else
29126 0 : goto invalid_keyword_type;
29127 0 : if (kwds2) {
29128 0 : if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
29129 : } else {
29130 0 : goto invalid_keyword;
29131 : }
29132 : }
29133 0 : Py_XDECREF(key);
29134 0 : Py_XDECREF(value);
29135 0 : return 0;
29136 0 : arg_passed_twice:
29137 0 : __Pyx_RaiseDoubleKeywordsError(function_name, key);
29138 0 : goto bad;
29139 0 : invalid_keyword_type:
29140 0 : PyErr_Format(PyExc_TypeError,
29141 : "%.200s() keywords must be strings", function_name);
29142 0 : goto bad;
29143 0 : invalid_keyword:
29144 : #if PY_MAJOR_VERSION < 3
29145 : PyErr_Format(PyExc_TypeError,
29146 : "%.200s() got an unexpected keyword argument '%.200s'",
29147 : function_name, PyString_AsString(key));
29148 : #else
29149 0 : PyErr_Format(PyExc_TypeError,
29150 : "%s() got an unexpected keyword argument '%U'",
29151 : function_name, key);
29152 : #endif
29153 0 : bad:
29154 0 : Py_XDECREF(key);
29155 0 : Py_XDECREF(value);
29156 0 : return -1;
29157 : }
29158 :
29159 : /* ArgTypeTest */
29160 0 : static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
29161 : {
29162 0 : __Pyx_TypeName type_name;
29163 0 : __Pyx_TypeName obj_type_name;
29164 0 : if (unlikely(!type)) {
29165 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
29166 0 : return 0;
29167 : }
29168 0 : else if (exact) {
29169 : #if PY_MAJOR_VERSION == 2
29170 : if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
29171 : #endif
29172 : }
29173 : else {
29174 0 : if (likely(__Pyx_TypeCheck(obj, type))) return 1;
29175 : }
29176 0 : type_name = __Pyx_PyType_GetName(type);
29177 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
29178 0 : PyErr_Format(PyExc_TypeError,
29179 : "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
29180 : ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name);
29181 0 : __Pyx_DECREF_TypeName(type_name);
29182 0 : __Pyx_DECREF_TypeName(obj_type_name);
29183 0 : return 0;
29184 : }
29185 :
29186 : /* RaiseException */
29187 : #if PY_MAJOR_VERSION < 3
29188 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
29189 : __Pyx_PyThreadState_declare
29190 : CYTHON_UNUSED_VAR(cause);
29191 : Py_XINCREF(type);
29192 : if (!value || value == Py_None)
29193 : value = NULL;
29194 : else
29195 : Py_INCREF(value);
29196 : if (!tb || tb == Py_None)
29197 : tb = NULL;
29198 : else {
29199 : Py_INCREF(tb);
29200 : if (!PyTraceBack_Check(tb)) {
29201 : PyErr_SetString(PyExc_TypeError,
29202 : "raise: arg 3 must be a traceback or None");
29203 : goto raise_error;
29204 : }
29205 : }
29206 : if (PyType_Check(type)) {
29207 : #if CYTHON_COMPILING_IN_PYPY
29208 : if (!value) {
29209 : Py_INCREF(Py_None);
29210 : value = Py_None;
29211 : }
29212 : #endif
29213 : PyErr_NormalizeException(&type, &value, &tb);
29214 : } else {
29215 : if (value) {
29216 : PyErr_SetString(PyExc_TypeError,
29217 : "instance exception may not have a separate value");
29218 : goto raise_error;
29219 : }
29220 : value = type;
29221 : type = (PyObject*) Py_TYPE(type);
29222 : Py_INCREF(type);
29223 : if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
29224 : PyErr_SetString(PyExc_TypeError,
29225 : "raise: exception class must be a subclass of BaseException");
29226 : goto raise_error;
29227 : }
29228 : }
29229 : __Pyx_PyThreadState_assign
29230 : __Pyx_ErrRestore(type, value, tb);
29231 : return;
29232 : raise_error:
29233 : Py_XDECREF(value);
29234 : Py_XDECREF(type);
29235 : Py_XDECREF(tb);
29236 : return;
29237 : }
29238 : #else
29239 44 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
29240 44 : PyObject* owned_instance = NULL;
29241 44 : if (tb == Py_None) {
29242 : tb = 0;
29243 44 : } else if (tb && !PyTraceBack_Check(tb)) {
29244 0 : PyErr_SetString(PyExc_TypeError,
29245 : "raise: arg 3 must be a traceback or None");
29246 0 : goto bad;
29247 : }
29248 44 : if (value == Py_None)
29249 0 : value = 0;
29250 44 : if (PyExceptionInstance_Check(type)) {
29251 44 : if (value) {
29252 0 : PyErr_SetString(PyExc_TypeError,
29253 : "instance exception may not have a separate value");
29254 0 : goto bad;
29255 : }
29256 : value = type;
29257 : type = (PyObject*) Py_TYPE(value);
29258 0 : } else if (PyExceptionClass_Check(type)) {
29259 0 : PyObject *instance_class = NULL;
29260 0 : if (value && PyExceptionInstance_Check(value)) {
29261 0 : instance_class = (PyObject*) Py_TYPE(value);
29262 0 : if (instance_class != type) {
29263 0 : int is_subclass = PyObject_IsSubclass(instance_class, type);
29264 0 : if (!is_subclass) {
29265 : instance_class = NULL;
29266 0 : } else if (unlikely(is_subclass == -1)) {
29267 0 : goto bad;
29268 : } else {
29269 : type = instance_class;
29270 : }
29271 : }
29272 : }
29273 : if (!instance_class) {
29274 0 : PyObject *args;
29275 0 : if (!value)
29276 0 : args = PyTuple_New(0);
29277 0 : else if (PyTuple_Check(value)) {
29278 0 : Py_INCREF(value);
29279 0 : args = value;
29280 : } else
29281 0 : args = PyTuple_Pack(1, value);
29282 0 : if (!args)
29283 0 : goto bad;
29284 0 : owned_instance = PyObject_Call(type, args, NULL);
29285 0 : Py_DECREF(args);
29286 0 : if (!owned_instance)
29287 0 : goto bad;
29288 0 : value = owned_instance;
29289 0 : if (!PyExceptionInstance_Check(value)) {
29290 0 : PyErr_Format(PyExc_TypeError,
29291 : "calling %R should have returned an instance of "
29292 : "BaseException, not %R",
29293 : type, Py_TYPE(value));
29294 0 : goto bad;
29295 : }
29296 : }
29297 : } else {
29298 0 : PyErr_SetString(PyExc_TypeError,
29299 : "raise: exception class must be a subclass of BaseException");
29300 0 : goto bad;
29301 : }
29302 44 : if (cause) {
29303 0 : PyObject *fixed_cause;
29304 0 : if (cause == Py_None) {
29305 : fixed_cause = NULL;
29306 0 : } else if (PyExceptionClass_Check(cause)) {
29307 0 : fixed_cause = PyObject_CallObject(cause, NULL);
29308 0 : if (fixed_cause == NULL)
29309 0 : goto bad;
29310 0 : } else if (PyExceptionInstance_Check(cause)) {
29311 0 : fixed_cause = cause;
29312 0 : Py_INCREF(fixed_cause);
29313 : } else {
29314 0 : PyErr_SetString(PyExc_TypeError,
29315 : "exception causes must derive from "
29316 : "BaseException");
29317 0 : goto bad;
29318 : }
29319 0 : PyException_SetCause(value, fixed_cause);
29320 : }
29321 44 : PyErr_SetObject(type, value);
29322 44 : if (tb) {
29323 : #if PY_VERSION_HEX >= 0x030C00A6
29324 0 : PyException_SetTraceback(value, tb);
29325 : #elif CYTHON_FAST_THREAD_STATE
29326 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
29327 : PyObject* tmp_tb = tstate->curexc_traceback;
29328 : if (tb != tmp_tb) {
29329 : Py_INCREF(tb);
29330 : tstate->curexc_traceback = tb;
29331 : Py_XDECREF(tmp_tb);
29332 : }
29333 : #else
29334 : PyObject *tmp_type, *tmp_value, *tmp_tb;
29335 : PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
29336 : Py_INCREF(tb);
29337 : PyErr_Restore(tmp_type, tmp_value, tb);
29338 : Py_XDECREF(tmp_tb);
29339 : #endif
29340 : }
29341 44 : bad:
29342 44 : Py_XDECREF(owned_instance);
29343 44 : return;
29344 : }
29345 : #endif
29346 :
29347 : /* PyFunctionFastCall */
29348 : #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
29349 : static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
29350 : PyObject *globals) {
29351 : PyFrameObject *f;
29352 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
29353 : PyObject **fastlocals;
29354 : Py_ssize_t i;
29355 : PyObject *result;
29356 : assert(globals != NULL);
29357 : /* XXX Perhaps we should create a specialized
29358 : PyFrame_New() that doesn't take locals, but does
29359 : take builtins without sanity checking them.
29360 : */
29361 : assert(tstate != NULL);
29362 : f = PyFrame_New(tstate, co, globals, NULL);
29363 : if (f == NULL) {
29364 : return NULL;
29365 : }
29366 : fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
29367 : for (i = 0; i < na; i++) {
29368 : Py_INCREF(*args);
29369 : fastlocals[i] = *args++;
29370 : }
29371 : result = PyEval_EvalFrameEx(f,0);
29372 : ++tstate->recursion_depth;
29373 : Py_DECREF(f);
29374 : --tstate->recursion_depth;
29375 : return result;
29376 : }
29377 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
29378 : PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
29379 : PyObject *globals = PyFunction_GET_GLOBALS(func);
29380 : PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
29381 : PyObject *closure;
29382 : #if PY_MAJOR_VERSION >= 3
29383 : PyObject *kwdefs;
29384 : #endif
29385 : PyObject *kwtuple, **k;
29386 : PyObject **d;
29387 : Py_ssize_t nd;
29388 : Py_ssize_t nk;
29389 : PyObject *result;
29390 : assert(kwargs == NULL || PyDict_Check(kwargs));
29391 : nk = kwargs ? PyDict_Size(kwargs) : 0;
29392 : #if PY_MAJOR_VERSION < 3
29393 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
29394 : return NULL;
29395 : }
29396 : #else
29397 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
29398 : return NULL;
29399 : }
29400 : #endif
29401 : if (
29402 : #if PY_MAJOR_VERSION >= 3
29403 : co->co_kwonlyargcount == 0 &&
29404 : #endif
29405 : likely(kwargs == NULL || nk == 0) &&
29406 : co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
29407 : if (argdefs == NULL && co->co_argcount == nargs) {
29408 : result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
29409 : goto done;
29410 : }
29411 : else if (nargs == 0 && argdefs != NULL
29412 : && co->co_argcount == Py_SIZE(argdefs)) {
29413 : /* function called with no arguments, but all parameters have
29414 : a default value: use default values as arguments .*/
29415 : args = &PyTuple_GET_ITEM(argdefs, 0);
29416 : result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
29417 : goto done;
29418 : }
29419 : }
29420 : if (kwargs != NULL) {
29421 : Py_ssize_t pos, i;
29422 : kwtuple = PyTuple_New(2 * nk);
29423 : if (kwtuple == NULL) {
29424 : result = NULL;
29425 : goto done;
29426 : }
29427 : k = &PyTuple_GET_ITEM(kwtuple, 0);
29428 : pos = i = 0;
29429 : while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
29430 : Py_INCREF(k[i]);
29431 : Py_INCREF(k[i+1]);
29432 : i += 2;
29433 : }
29434 : nk = i / 2;
29435 : }
29436 : else {
29437 : kwtuple = NULL;
29438 : k = NULL;
29439 : }
29440 : closure = PyFunction_GET_CLOSURE(func);
29441 : #if PY_MAJOR_VERSION >= 3
29442 : kwdefs = PyFunction_GET_KW_DEFAULTS(func);
29443 : #endif
29444 : if (argdefs != NULL) {
29445 : d = &PyTuple_GET_ITEM(argdefs, 0);
29446 : nd = Py_SIZE(argdefs);
29447 : }
29448 : else {
29449 : d = NULL;
29450 : nd = 0;
29451 : }
29452 : #if PY_MAJOR_VERSION >= 3
29453 : result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
29454 : args, (int)nargs,
29455 : k, (int)nk,
29456 : d, (int)nd, kwdefs, closure);
29457 : #else
29458 : result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
29459 : args, (int)nargs,
29460 : k, (int)nk,
29461 : d, (int)nd, closure);
29462 : #endif
29463 : Py_XDECREF(kwtuple);
29464 : done:
29465 : Py_LeaveRecursiveCall();
29466 : return result;
29467 : }
29468 : #endif
29469 :
29470 : /* PyObjectCall */
29471 : #if CYTHON_COMPILING_IN_CPYTHON
29472 3505 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
29473 3505 : PyObject *result;
29474 3505 : ternaryfunc call = Py_TYPE(func)->tp_call;
29475 3505 : if (unlikely(!call))
29476 0 : return PyObject_Call(func, arg, kw);
29477 : #if PY_MAJOR_VERSION < 3
29478 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
29479 : return NULL;
29480 : #else
29481 3505 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
29482 : return NULL;
29483 : #endif
29484 3505 : result = (*call)(func, arg, kw);
29485 3505 : Py_LeaveRecursiveCall();
29486 3505 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
29487 0 : PyErr_SetString(
29488 : PyExc_SystemError,
29489 : "NULL result without error in PyObject_Call");
29490 : }
29491 : return result;
29492 : }
29493 : #endif
29494 :
29495 : /* PyObjectCallMethO */
29496 : #if CYTHON_COMPILING_IN_CPYTHON
29497 0 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
29498 0 : PyObject *self, *result;
29499 0 : PyCFunction cfunc;
29500 0 : cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
29501 0 : self = __Pyx_CyOrPyCFunction_GET_SELF(func);
29502 : #if PY_MAJOR_VERSION < 3
29503 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
29504 : return NULL;
29505 : #else
29506 0 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
29507 : return NULL;
29508 : #endif
29509 0 : result = cfunc(self, arg);
29510 0 : Py_LeaveRecursiveCall();
29511 0 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
29512 0 : PyErr_SetString(
29513 : PyExc_SystemError,
29514 : "NULL result without error in PyObject_Call");
29515 : }
29516 : return result;
29517 : }
29518 : #endif
29519 :
29520 : /* PyObjectFastCall */
29521 : #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
29522 : static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
29523 : PyObject *argstuple;
29524 : PyObject *result = 0;
29525 : size_t i;
29526 : argstuple = PyTuple_New((Py_ssize_t)nargs);
29527 : if (unlikely(!argstuple)) return NULL;
29528 : for (i = 0; i < nargs; i++) {
29529 : Py_INCREF(args[i]);
29530 : if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
29531 : }
29532 : result = __Pyx_PyObject_Call(func, argstuple, kwargs);
29533 : bad:
29534 : Py_DECREF(argstuple);
29535 : return result;
29536 : }
29537 : #endif
29538 1528 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
29539 1528 : Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
29540 : #if CYTHON_COMPILING_IN_CPYTHON
29541 1528 : if (nargs == 0 && kwargs == NULL) {
29542 0 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
29543 0 : return __Pyx_PyObject_CallMethO(func, NULL);
29544 : }
29545 1528 : else if (nargs == 1 && kwargs == NULL) {
29546 1306 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
29547 0 : return __Pyx_PyObject_CallMethO(func, args[0]);
29548 : }
29549 : #endif
29550 : #if PY_VERSION_HEX < 0x030800B1
29551 : #if CYTHON_FAST_PYCCALL
29552 : if (PyCFunction_Check(func)) {
29553 : if (kwargs) {
29554 : return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
29555 : } else {
29556 : return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
29557 : }
29558 : }
29559 : #if PY_VERSION_HEX >= 0x030700A1
29560 : if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
29561 : return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
29562 : }
29563 : #endif
29564 : #endif
29565 : #if CYTHON_FAST_PYCALL
29566 : if (PyFunction_Check(func)) {
29567 : return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
29568 : }
29569 : #endif
29570 : #endif
29571 1528 : if (kwargs == NULL) {
29572 : #if CYTHON_VECTORCALL
29573 : #if PY_VERSION_HEX < 0x03090000
29574 : vectorcallfunc f = _PyVectorcall_Function(func);
29575 : #else
29576 1528 : vectorcallfunc f = PyVectorcall_Function(func);
29577 : #endif
29578 1528 : if (f) {
29579 1393 : return f(func, args, (size_t)nargs, NULL);
29580 : }
29581 : #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
29582 : if (__Pyx_CyFunction_CheckExact(func)) {
29583 : __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
29584 : if (f) return f(func, args, (size_t)nargs, NULL);
29585 : }
29586 : #endif
29587 : }
29588 135 : if (nargs == 0) {
29589 0 : return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
29590 : }
29591 : #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
29592 135 : return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
29593 : #else
29594 : return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
29595 : #endif
29596 : }
29597 :
29598 : /* RaiseUnexpectedTypeError */
29599 : static int
29600 0 : __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
29601 : {
29602 0 : __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
29603 0 : PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
29604 : expected, obj_type_name);
29605 0 : __Pyx_DECREF_TypeName(obj_type_name);
29606 0 : return 0;
29607 : }
29608 :
29609 : /* CIntToDigits */
29610 : static const char DIGIT_PAIRS_10[2*10*10+1] = {
29611 : "00010203040506070809"
29612 : "10111213141516171819"
29613 : "20212223242526272829"
29614 : "30313233343536373839"
29615 : "40414243444546474849"
29616 : "50515253545556575859"
29617 : "60616263646566676869"
29618 : "70717273747576777879"
29619 : "80818283848586878889"
29620 : "90919293949596979899"
29621 : };
29622 : static const char DIGIT_PAIRS_8[2*8*8+1] = {
29623 : "0001020304050607"
29624 : "1011121314151617"
29625 : "2021222324252627"
29626 : "3031323334353637"
29627 : "4041424344454647"
29628 : "5051525354555657"
29629 : "6061626364656667"
29630 : "7071727374757677"
29631 : };
29632 : static const char DIGITS_HEX[2*16+1] = {
29633 : "0123456789abcdef"
29634 : "0123456789ABCDEF"
29635 : };
29636 :
29637 : /* BuildPyUnicode */
29638 0 : static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
29639 : int prepend_sign, char padding_char) {
29640 0 : PyObject *uval;
29641 0 : Py_ssize_t uoffset = ulength - clength;
29642 : #if CYTHON_USE_UNICODE_INTERNALS
29643 0 : Py_ssize_t i;
29644 : #if CYTHON_PEP393_ENABLED
29645 0 : void *udata;
29646 0 : uval = PyUnicode_New(ulength, 127);
29647 0 : if (unlikely(!uval)) return NULL;
29648 0 : udata = PyUnicode_DATA(uval);
29649 : #else
29650 : Py_UNICODE *udata;
29651 : uval = PyUnicode_FromUnicode(NULL, ulength);
29652 : if (unlikely(!uval)) return NULL;
29653 : udata = PyUnicode_AS_UNICODE(uval);
29654 : #endif
29655 0 : if (uoffset > 0) {
29656 0 : i = 0;
29657 0 : if (prepend_sign) {
29658 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
29659 0 : i++;
29660 : }
29661 0 : for (; i < uoffset; i++) {
29662 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
29663 : }
29664 : }
29665 0 : for (i=0; i < clength; i++) {
29666 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
29667 : }
29668 : #else
29669 : {
29670 : PyObject *sign = NULL, *padding = NULL;
29671 : uval = NULL;
29672 : if (uoffset > 0) {
29673 : prepend_sign = !!prepend_sign;
29674 : if (uoffset > prepend_sign) {
29675 : padding = PyUnicode_FromOrdinal(padding_char);
29676 : if (likely(padding) && uoffset > prepend_sign + 1) {
29677 : PyObject *tmp;
29678 : PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
29679 : if (unlikely(!repeat)) goto done_or_error;
29680 : tmp = PyNumber_Multiply(padding, repeat);
29681 : Py_DECREF(repeat);
29682 : Py_DECREF(padding);
29683 : padding = tmp;
29684 : }
29685 : if (unlikely(!padding)) goto done_or_error;
29686 : }
29687 : if (prepend_sign) {
29688 : sign = PyUnicode_FromOrdinal('-');
29689 : if (unlikely(!sign)) goto done_or_error;
29690 : }
29691 : }
29692 : uval = PyUnicode_DecodeASCII(chars, clength, NULL);
29693 : if (likely(uval) && padding) {
29694 : PyObject *tmp = PyNumber_Add(padding, uval);
29695 : Py_DECREF(uval);
29696 : uval = tmp;
29697 : }
29698 : if (likely(uval) && sign) {
29699 : PyObject *tmp = PyNumber_Add(sign, uval);
29700 : Py_DECREF(uval);
29701 : uval = tmp;
29702 : }
29703 : done_or_error:
29704 : Py_XDECREF(padding);
29705 : Py_XDECREF(sign);
29706 : }
29707 : #endif
29708 : return uval;
29709 : }
29710 :
29711 : /* CIntToPyUnicode */
29712 0 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
29713 0 : char digits[sizeof(int)*3+2];
29714 0 : char *dpos, *end = digits + sizeof(int)*3+2;
29715 0 : const char *hex_digits = DIGITS_HEX;
29716 0 : Py_ssize_t length, ulength;
29717 0 : int prepend_sign, last_one_off;
29718 0 : int remaining;
29719 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29720 : #pragma GCC diagnostic push
29721 : #pragma GCC diagnostic ignored "-Wconversion"
29722 : #endif
29723 0 : const int neg_one = (int) -1, const_zero = (int) 0;
29724 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29725 : #pragma GCC diagnostic pop
29726 : #endif
29727 0 : const int is_unsigned = neg_one > const_zero;
29728 0 : if (format_char == 'X') {
29729 0 : hex_digits += 16;
29730 0 : format_char = 'x';
29731 : }
29732 0 : remaining = value;
29733 0 : last_one_off = 0;
29734 0 : dpos = end;
29735 0 : do {
29736 0 : int digit_pos;
29737 0 : switch (format_char) {
29738 0 : case 'o':
29739 0 : digit_pos = abs((int)(remaining % (8*8)));
29740 0 : remaining = (int) (remaining / (8*8));
29741 0 : dpos -= 2;
29742 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
29743 0 : last_one_off = (digit_pos < 8);
29744 0 : break;
29745 0 : case 'd':
29746 0 : digit_pos = abs((int)(remaining % (10*10)));
29747 0 : remaining = (int) (remaining / (10*10));
29748 0 : dpos -= 2;
29749 0 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
29750 0 : last_one_off = (digit_pos < 10);
29751 0 : break;
29752 0 : case 'x':
29753 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
29754 0 : remaining = (int) (remaining / 16);
29755 0 : break;
29756 : default:
29757 : assert(0);
29758 : break;
29759 : }
29760 0 : } while (unlikely(remaining != 0));
29761 0 : assert(!last_one_off || *dpos == '0');
29762 0 : dpos += last_one_off;
29763 0 : length = end - dpos;
29764 0 : ulength = length;
29765 0 : prepend_sign = 0;
29766 0 : if (!is_unsigned && value <= neg_one) {
29767 0 : if (padding_char == ' ' || width <= length + 1) {
29768 0 : *(--dpos) = '-';
29769 0 : ++length;
29770 : } else {
29771 : prepend_sign = 1;
29772 : }
29773 0 : ++ulength;
29774 : }
29775 0 : if (width > ulength) {
29776 : ulength = width;
29777 : }
29778 0 : if (ulength == 1) {
29779 0 : return PyUnicode_FromOrdinal(*dpos);
29780 : }
29781 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
29782 : }
29783 :
29784 : /* CIntToPyUnicode */
29785 0 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
29786 0 : char digits[sizeof(Py_ssize_t)*3+2];
29787 0 : char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
29788 0 : const char *hex_digits = DIGITS_HEX;
29789 0 : Py_ssize_t length, ulength;
29790 0 : int prepend_sign, last_one_off;
29791 0 : Py_ssize_t remaining;
29792 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29793 : #pragma GCC diagnostic push
29794 : #pragma GCC diagnostic ignored "-Wconversion"
29795 : #endif
29796 0 : const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
29797 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29798 : #pragma GCC diagnostic pop
29799 : #endif
29800 0 : const int is_unsigned = neg_one > const_zero;
29801 0 : if (format_char == 'X') {
29802 0 : hex_digits += 16;
29803 0 : format_char = 'x';
29804 : }
29805 0 : remaining = value;
29806 0 : last_one_off = 0;
29807 0 : dpos = end;
29808 0 : do {
29809 0 : int digit_pos;
29810 0 : switch (format_char) {
29811 0 : case 'o':
29812 0 : digit_pos = abs((int)(remaining % (8*8)));
29813 0 : remaining = (Py_ssize_t) (remaining / (8*8));
29814 0 : dpos -= 2;
29815 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
29816 0 : last_one_off = (digit_pos < 8);
29817 0 : break;
29818 0 : case 'd':
29819 0 : digit_pos = abs((int)(remaining % (10*10)));
29820 0 : remaining = (Py_ssize_t) (remaining / (10*10));
29821 0 : dpos -= 2;
29822 0 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
29823 0 : last_one_off = (digit_pos < 10);
29824 0 : break;
29825 0 : case 'x':
29826 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
29827 0 : remaining = (Py_ssize_t) (remaining / 16);
29828 0 : break;
29829 : default:
29830 : assert(0);
29831 : break;
29832 : }
29833 0 : } while (unlikely(remaining != 0));
29834 0 : assert(!last_one_off || *dpos == '0');
29835 0 : dpos += last_one_off;
29836 0 : length = end - dpos;
29837 0 : ulength = length;
29838 0 : prepend_sign = 0;
29839 0 : if (!is_unsigned && value <= neg_one) {
29840 0 : if (padding_char == ' ' || width <= length + 1) {
29841 0 : *(--dpos) = '-';
29842 0 : ++length;
29843 : } else {
29844 : prepend_sign = 1;
29845 : }
29846 0 : ++ulength;
29847 : }
29848 0 : if (width > ulength) {
29849 : ulength = width;
29850 : }
29851 0 : if (ulength == 1) {
29852 0 : return PyUnicode_FromOrdinal(*dpos);
29853 : }
29854 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
29855 : }
29856 :
29857 : /* JoinPyUnicode */
29858 0 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
29859 : Py_UCS4 max_char) {
29860 : #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29861 0 : PyObject *result_uval;
29862 0 : int result_ukind, kind_shift;
29863 0 : Py_ssize_t i, char_pos;
29864 0 : void *result_udata;
29865 0 : CYTHON_MAYBE_UNUSED_VAR(max_char);
29866 : #if CYTHON_PEP393_ENABLED
29867 0 : result_uval = PyUnicode_New(result_ulength, max_char);
29868 0 : if (unlikely(!result_uval)) return NULL;
29869 0 : result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
29870 0 : kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
29871 0 : result_udata = PyUnicode_DATA(result_uval);
29872 : #else
29873 : result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
29874 : if (unlikely(!result_uval)) return NULL;
29875 : result_ukind = sizeof(Py_UNICODE);
29876 : kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
29877 : result_udata = PyUnicode_AS_UNICODE(result_uval);
29878 : #endif
29879 0 : assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
29880 0 : char_pos = 0;
29881 0 : for (i=0; i < value_count; i++) {
29882 0 : int ukind;
29883 0 : Py_ssize_t ulength;
29884 0 : void *udata;
29885 0 : PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
29886 0 : if (unlikely(__Pyx_PyUnicode_READY(uval)))
29887 : goto bad;
29888 0 : ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
29889 0 : if (unlikely(!ulength))
29890 0 : continue;
29891 0 : if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
29892 0 : goto overflow;
29893 0 : ukind = __Pyx_PyUnicode_KIND(uval);
29894 0 : udata = __Pyx_PyUnicode_DATA(uval);
29895 0 : if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
29896 0 : memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
29897 : } else {
29898 : #if PY_VERSION_HEX >= 0x030d0000
29899 : if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
29900 : #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
29901 0 : _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
29902 : #else
29903 : Py_ssize_t j;
29904 : for (j=0; j < ulength; j++) {
29905 : Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
29906 : __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
29907 : }
29908 : #endif
29909 : }
29910 0 : char_pos += ulength;
29911 : }
29912 : return result_uval;
29913 0 : overflow:
29914 0 : PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
29915 0 : bad:
29916 0 : Py_DECREF(result_uval);
29917 : return NULL;
29918 : #else
29919 : CYTHON_UNUSED_VAR(max_char);
29920 : CYTHON_UNUSED_VAR(result_ulength);
29921 : CYTHON_UNUSED_VAR(value_count);
29922 : return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
29923 : #endif
29924 : }
29925 :
29926 : /* GetAttr */
29927 0 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
29928 : #if CYTHON_USE_TYPE_SLOTS
29929 : #if PY_MAJOR_VERSION >= 3
29930 0 : if (likely(PyUnicode_Check(n)))
29931 : #else
29932 : if (likely(PyString_Check(n)))
29933 : #endif
29934 0 : return __Pyx_PyObject_GetAttrStr(o, n);
29935 : #endif
29936 0 : return PyObject_GetAttr(o, n);
29937 : }
29938 :
29939 : /* GetItemInt */
29940 0 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
29941 0 : PyObject *r;
29942 0 : if (unlikely(!j)) return NULL;
29943 0 : r = PyObject_GetItem(o, j);
29944 0 : Py_DECREF(j);
29945 : return r;
29946 : }
29947 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
29948 : CYTHON_NCP_UNUSED int wraparound,
29949 : CYTHON_NCP_UNUSED int boundscheck) {
29950 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29951 : Py_ssize_t wrapped_i = i;
29952 : if (wraparound & unlikely(i < 0)) {
29953 : wrapped_i += PyList_GET_SIZE(o);
29954 : }
29955 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
29956 : PyObject *r = PyList_GET_ITEM(o, wrapped_i);
29957 : Py_INCREF(r);
29958 : return r;
29959 : }
29960 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29961 : #else
29962 : return PySequence_GetItem(o, i);
29963 : #endif
29964 : }
29965 0 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
29966 : CYTHON_NCP_UNUSED int wraparound,
29967 : CYTHON_NCP_UNUSED int boundscheck) {
29968 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29969 0 : Py_ssize_t wrapped_i = i;
29970 0 : if (wraparound & unlikely(i < 0)) {
29971 0 : wrapped_i += PyTuple_GET_SIZE(o);
29972 : }
29973 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
29974 0 : PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
29975 0 : Py_INCREF(r);
29976 0 : return r;
29977 : }
29978 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29979 : #else
29980 : return PySequence_GetItem(o, i);
29981 : #endif
29982 : }
29983 0 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
29984 : CYTHON_NCP_UNUSED int wraparound,
29985 : CYTHON_NCP_UNUSED int boundscheck) {
29986 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
29987 0 : if (is_list || PyList_CheckExact(o)) {
29988 0 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
29989 0 : if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
29990 0 : PyObject *r = PyList_GET_ITEM(o, n);
29991 0 : Py_INCREF(r);
29992 0 : return r;
29993 : }
29994 : }
29995 0 : else if (PyTuple_CheckExact(o)) {
29996 0 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
29997 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
29998 0 : PyObject *r = PyTuple_GET_ITEM(o, n);
29999 0 : Py_INCREF(r);
30000 0 : return r;
30001 : }
30002 : } else {
30003 0 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
30004 0 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
30005 0 : if (mm && mm->mp_subscript) {
30006 0 : PyObject *r, *key = PyInt_FromSsize_t(i);
30007 0 : if (unlikely(!key)) return NULL;
30008 0 : r = mm->mp_subscript(o, key);
30009 0 : Py_DECREF(key);
30010 0 : return r;
30011 : }
30012 0 : if (likely(sm && sm->sq_item)) {
30013 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
30014 0 : Py_ssize_t l = sm->sq_length(o);
30015 0 : if (likely(l >= 0)) {
30016 0 : i += l;
30017 : } else {
30018 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
30019 : return NULL;
30020 0 : PyErr_Clear();
30021 : }
30022 : }
30023 0 : return sm->sq_item(o, i);
30024 : }
30025 : }
30026 : #else
30027 : if (is_list || !PyMapping_Check(o)) {
30028 : return PySequence_GetItem(o, i);
30029 : }
30030 : #endif
30031 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
30032 : }
30033 :
30034 : /* PyObjectCallOneArg */
30035 2 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
30036 2 : PyObject *args[2] = {NULL, arg};
30037 2 : return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
30038 : }
30039 :
30040 : /* ObjectGetItem */
30041 : #if CYTHON_USE_TYPE_SLOTS
30042 0 : static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
30043 0 : PyObject *runerr = NULL;
30044 0 : Py_ssize_t key_value;
30045 0 : key_value = __Pyx_PyIndex_AsSsize_t(index);
30046 0 : if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
30047 0 : return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
30048 : }
30049 0 : if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
30050 0 : __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
30051 0 : PyErr_Clear();
30052 0 : PyErr_Format(PyExc_IndexError,
30053 : "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
30054 : __Pyx_DECREF_TypeName(index_type_name);
30055 : }
30056 : return NULL;
30057 : }
30058 0 : static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
30059 0 : __Pyx_TypeName obj_type_name;
30060 0 : if (likely(PyType_Check(obj))) {
30061 0 : PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
30062 0 : if (!meth) {
30063 0 : PyErr_Clear();
30064 : } else {
30065 0 : PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
30066 0 : Py_DECREF(meth);
30067 0 : return result;
30068 : }
30069 : }
30070 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
30071 0 : PyErr_Format(PyExc_TypeError,
30072 : "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
30073 0 : __Pyx_DECREF_TypeName(obj_type_name);
30074 0 : return NULL;
30075 : }
30076 2 : static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
30077 2 : PyTypeObject *tp = Py_TYPE(obj);
30078 2 : PyMappingMethods *mm = tp->tp_as_mapping;
30079 2 : PySequenceMethods *sm = tp->tp_as_sequence;
30080 2 : if (likely(mm && mm->mp_subscript)) {
30081 2 : return mm->mp_subscript(obj, key);
30082 : }
30083 0 : if (likely(sm && sm->sq_item)) {
30084 0 : return __Pyx_PyObject_GetIndex(obj, key);
30085 : }
30086 0 : return __Pyx_PyObject_GetItem_Slow(obj, key);
30087 : }
30088 : #endif
30089 :
30090 : /* KeywordStringCheck */
30091 0 : static int __Pyx_CheckKeywordStrings(
30092 : PyObject *kw,
30093 : const char* function_name,
30094 : int kw_allowed)
30095 : {
30096 0 : PyObject* key = 0;
30097 0 : Py_ssize_t pos = 0;
30098 : #if CYTHON_COMPILING_IN_PYPY
30099 : if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
30100 : goto invalid_keyword;
30101 : return 1;
30102 : #else
30103 0 : if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
30104 0 : Py_ssize_t kwsize;
30105 : #if CYTHON_ASSUME_SAFE_MACROS
30106 0 : kwsize = PyTuple_GET_SIZE(kw);
30107 : #else
30108 : kwsize = PyTuple_Size(kw);
30109 : if (kwsize < 0) return 0;
30110 : #endif
30111 0 : if (unlikely(kwsize == 0))
30112 : return 1;
30113 0 : if (!kw_allowed) {
30114 : #if CYTHON_ASSUME_SAFE_MACROS
30115 0 : key = PyTuple_GET_ITEM(kw, 0);
30116 : #else
30117 : key = PyTuple_GetItem(kw, pos);
30118 : if (!key) return 0;
30119 : #endif
30120 0 : goto invalid_keyword;
30121 : }
30122 : #if PY_VERSION_HEX < 0x03090000
30123 : for (pos = 0; pos < kwsize; pos++) {
30124 : #if CYTHON_ASSUME_SAFE_MACROS
30125 : key = PyTuple_GET_ITEM(kw, pos);
30126 : #else
30127 : key = PyTuple_GetItem(kw, pos);
30128 : if (!key) return 0;
30129 : #endif
30130 : if (unlikely(!PyUnicode_Check(key)))
30131 : goto invalid_keyword_type;
30132 : }
30133 : #endif
30134 : return 1;
30135 : }
30136 0 : while (PyDict_Next(kw, &pos, &key, 0)) {
30137 : #if PY_MAJOR_VERSION < 3
30138 : if (unlikely(!PyString_Check(key)))
30139 : #endif
30140 0 : if (unlikely(!PyUnicode_Check(key)))
30141 0 : goto invalid_keyword_type;
30142 : }
30143 0 : if (!kw_allowed && unlikely(key))
30144 0 : goto invalid_keyword;
30145 : return 1;
30146 0 : invalid_keyword_type:
30147 0 : PyErr_Format(PyExc_TypeError,
30148 : "%.200s() keywords must be strings", function_name);
30149 0 : return 0;
30150 : #endif
30151 0 : invalid_keyword:
30152 : #if PY_MAJOR_VERSION < 3
30153 : PyErr_Format(PyExc_TypeError,
30154 : "%.200s() got an unexpected keyword argument '%.200s'",
30155 : function_name, PyString_AsString(key));
30156 : #else
30157 0 : PyErr_Format(PyExc_TypeError,
30158 : "%s() got an unexpected keyword argument '%U'",
30159 : function_name, key);
30160 : #endif
30161 0 : return 0;
30162 : }
30163 :
30164 : /* DivInt[Py_ssize_t] */
30165 0 : static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
30166 0 : Py_ssize_t q = a / b;
30167 0 : Py_ssize_t r = a - q*b;
30168 0 : q -= ((r != 0) & ((r ^ b) < 0));
30169 0 : return q;
30170 : }
30171 :
30172 : /* GetAttr3 */
30173 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
30174 0 : static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
30175 0 : __Pyx_PyThreadState_declare
30176 0 : __Pyx_PyThreadState_assign
30177 0 : if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
30178 : return NULL;
30179 0 : __Pyx_PyErr_Clear();
30180 0 : Py_INCREF(d);
30181 : return d;
30182 : }
30183 : #endif
30184 0 : static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
30185 0 : PyObject *r;
30186 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
30187 : int res = PyObject_GetOptionalAttr(o, n, &r);
30188 : return (res != 0) ? r : __Pyx_NewRef(d);
30189 : #else
30190 : #if CYTHON_USE_TYPE_SLOTS
30191 0 : if (likely(PyString_Check(n))) {
30192 0 : r = __Pyx_PyObject_GetAttrStrNoError(o, n);
30193 0 : if (unlikely(!r) && likely(!PyErr_Occurred())) {
30194 0 : r = __Pyx_NewRef(d);
30195 : }
30196 0 : return r;
30197 : }
30198 : #endif
30199 0 : r = PyObject_GetAttr(o, n);
30200 0 : return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
30201 : #endif
30202 : }
30203 :
30204 : /* PyDictVersioning */
30205 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
30206 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
30207 : PyObject *dict = Py_TYPE(obj)->tp_dict;
30208 : return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
30209 : }
30210 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
30211 : PyObject **dictptr = NULL;
30212 : Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
30213 : if (offset) {
30214 : #if CYTHON_COMPILING_IN_CPYTHON
30215 : dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
30216 : #else
30217 : dictptr = _PyObject_GetDictPtr(obj);
30218 : #endif
30219 : }
30220 : return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
30221 : }
30222 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
30223 : PyObject *dict = Py_TYPE(obj)->tp_dict;
30224 : if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
30225 : return 0;
30226 : return obj_dict_version == __Pyx_get_object_dict_version(obj);
30227 : }
30228 : #endif
30229 :
30230 : /* GetModuleGlobalName */
30231 : #if CYTHON_USE_DICT_VERSIONS
30232 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
30233 : #else
30234 4507 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
30235 : #endif
30236 : {
30237 4507 : PyObject *result;
30238 : #if !CYTHON_AVOID_BORROWED_REFS
30239 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
30240 4507 : result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
30241 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
30242 4507 : if (likely(result)) {
30243 9014 : return __Pyx_NewRef(result);
30244 0 : } else if (unlikely(PyErr_Occurred())) {
30245 : return NULL;
30246 : }
30247 : #elif CYTHON_COMPILING_IN_LIMITED_API
30248 : if (unlikely(!__pyx_m)) {
30249 : return NULL;
30250 : }
30251 : result = PyObject_GetAttr(__pyx_m, name);
30252 : if (likely(result)) {
30253 : return result;
30254 : }
30255 : #else
30256 : result = PyDict_GetItem(__pyx_d, name);
30257 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
30258 : if (likely(result)) {
30259 : return __Pyx_NewRef(result);
30260 : }
30261 : #endif
30262 : #else
30263 : result = PyObject_GetItem(__pyx_d, name);
30264 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
30265 : if (likely(result)) {
30266 : return __Pyx_NewRef(result);
30267 : }
30268 : PyErr_Clear();
30269 : #endif
30270 0 : return __Pyx_GetBuiltinName(name);
30271 : }
30272 :
30273 : /* RaiseTooManyValuesToUnpack */
30274 0 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
30275 0 : PyErr_Format(PyExc_ValueError,
30276 : "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
30277 0 : }
30278 :
30279 : /* RaiseNeedMoreValuesToUnpack */
30280 0 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
30281 0 : PyErr_Format(PyExc_ValueError,
30282 : "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
30283 : index, (index == 1) ? "" : "s");
30284 0 : }
30285 :
30286 : /* RaiseNoneIterError */
30287 0 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
30288 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
30289 : }
30290 :
30291 : /* ExtTypeTest */
30292 0 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
30293 0 : __Pyx_TypeName obj_type_name;
30294 0 : __Pyx_TypeName type_name;
30295 0 : if (unlikely(!type)) {
30296 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
30297 0 : return 0;
30298 : }
30299 0 : if (likely(__Pyx_TypeCheck(obj, type)))
30300 : return 1;
30301 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
30302 0 : type_name = __Pyx_PyType_GetName(type);
30303 0 : PyErr_Format(PyExc_TypeError,
30304 : "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
30305 : obj_type_name, type_name);
30306 0 : __Pyx_DECREF_TypeName(obj_type_name);
30307 0 : __Pyx_DECREF_TypeName(type_name);
30308 0 : return 0;
30309 : }
30310 :
30311 : /* GetTopmostException */
30312 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
30313 : static _PyErr_StackItem *
30314 5 : __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
30315 : {
30316 5 : _PyErr_StackItem *exc_info = tstate->exc_info;
30317 25 : while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
30318 25 : exc_info->previous_item != NULL)
30319 : {
30320 : exc_info = exc_info->previous_item;
30321 : }
30322 5 : return exc_info;
30323 : }
30324 : #endif
30325 :
30326 : /* SaveResetException */
30327 : #if CYTHON_FAST_THREAD_STATE
30328 5 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
30329 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
30330 5 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
30331 5 : PyObject *exc_value = exc_info->exc_value;
30332 5 : if (exc_value == NULL || exc_value == Py_None) {
30333 5 : *value = NULL;
30334 5 : *type = NULL;
30335 5 : *tb = NULL;
30336 : } else {
30337 0 : *value = exc_value;
30338 0 : Py_INCREF(*value);
30339 0 : *type = (PyObject*) Py_TYPE(exc_value);
30340 0 : Py_INCREF(*type);
30341 0 : *tb = PyException_GetTraceback(exc_value);
30342 : }
30343 : #elif CYTHON_USE_EXC_INFO_STACK
30344 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
30345 : *type = exc_info->exc_type;
30346 : *value = exc_info->exc_value;
30347 : *tb = exc_info->exc_traceback;
30348 : Py_XINCREF(*type);
30349 : Py_XINCREF(*value);
30350 : Py_XINCREF(*tb);
30351 : #else
30352 : *type = tstate->exc_type;
30353 : *value = tstate->exc_value;
30354 : *tb = tstate->exc_traceback;
30355 : Py_XINCREF(*type);
30356 : Py_XINCREF(*value);
30357 : Py_XINCREF(*tb);
30358 : #endif
30359 5 : }
30360 0 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
30361 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
30362 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
30363 0 : PyObject *tmp_value = exc_info->exc_value;
30364 0 : exc_info->exc_value = value;
30365 0 : Py_XDECREF(tmp_value);
30366 0 : Py_XDECREF(type);
30367 0 : Py_XDECREF(tb);
30368 : #else
30369 : PyObject *tmp_type, *tmp_value, *tmp_tb;
30370 : #if CYTHON_USE_EXC_INFO_STACK
30371 : _PyErr_StackItem *exc_info = tstate->exc_info;
30372 : tmp_type = exc_info->exc_type;
30373 : tmp_value = exc_info->exc_value;
30374 : tmp_tb = exc_info->exc_traceback;
30375 : exc_info->exc_type = type;
30376 : exc_info->exc_value = value;
30377 : exc_info->exc_traceback = tb;
30378 : #else
30379 : tmp_type = tstate->exc_type;
30380 : tmp_value = tstate->exc_value;
30381 : tmp_tb = tstate->exc_traceback;
30382 : tstate->exc_type = type;
30383 : tstate->exc_value = value;
30384 : tstate->exc_traceback = tb;
30385 : #endif
30386 : Py_XDECREF(tmp_type);
30387 : Py_XDECREF(tmp_value);
30388 : Py_XDECREF(tmp_tb);
30389 : #endif
30390 0 : }
30391 : #endif
30392 :
30393 : /* GetException */
30394 : #if CYTHON_FAST_THREAD_STATE
30395 0 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
30396 : #else
30397 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
30398 : #endif
30399 : {
30400 0 : PyObject *local_type = NULL, *local_value, *local_tb = NULL;
30401 : #if CYTHON_FAST_THREAD_STATE
30402 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
30403 : #if PY_VERSION_HEX >= 0x030C00A6
30404 0 : local_value = tstate->current_exception;
30405 0 : tstate->current_exception = 0;
30406 0 : if (likely(local_value)) {
30407 0 : local_type = (PyObject*) Py_TYPE(local_value);
30408 0 : Py_INCREF(local_type);
30409 0 : local_tb = PyException_GetTraceback(local_value);
30410 : }
30411 : #else
30412 : local_type = tstate->curexc_type;
30413 : local_value = tstate->curexc_value;
30414 : local_tb = tstate->curexc_traceback;
30415 : tstate->curexc_type = 0;
30416 : tstate->curexc_value = 0;
30417 : tstate->curexc_traceback = 0;
30418 : #endif
30419 : #else
30420 : PyErr_Fetch(&local_type, &local_value, &local_tb);
30421 : #endif
30422 0 : PyErr_NormalizeException(&local_type, &local_value, &local_tb);
30423 : #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
30424 0 : if (unlikely(tstate->current_exception))
30425 : #elif CYTHON_FAST_THREAD_STATE
30426 : if (unlikely(tstate->curexc_type))
30427 : #else
30428 : if (unlikely(PyErr_Occurred()))
30429 : #endif
30430 0 : goto bad;
30431 : #if PY_MAJOR_VERSION >= 3
30432 0 : if (local_tb) {
30433 0 : if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
30434 0 : goto bad;
30435 : }
30436 : #endif
30437 0 : Py_XINCREF(local_tb);
30438 0 : Py_XINCREF(local_type);
30439 0 : Py_XINCREF(local_value);
30440 0 : *type = local_type;
30441 0 : *value = local_value;
30442 0 : *tb = local_tb;
30443 : #if CYTHON_FAST_THREAD_STATE
30444 : #if CYTHON_USE_EXC_INFO_STACK
30445 : {
30446 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
30447 : #if PY_VERSION_HEX >= 0x030B00a4
30448 0 : tmp_value = exc_info->exc_value;
30449 0 : exc_info->exc_value = local_value;
30450 0 : tmp_type = NULL;
30451 0 : tmp_tb = NULL;
30452 0 : Py_XDECREF(local_type);
30453 0 : Py_XDECREF(local_tb);
30454 : #else
30455 : tmp_type = exc_info->exc_type;
30456 : tmp_value = exc_info->exc_value;
30457 : tmp_tb = exc_info->exc_traceback;
30458 : exc_info->exc_type = local_type;
30459 : exc_info->exc_value = local_value;
30460 : exc_info->exc_traceback = local_tb;
30461 : #endif
30462 : }
30463 : #else
30464 : tmp_type = tstate->exc_type;
30465 : tmp_value = tstate->exc_value;
30466 : tmp_tb = tstate->exc_traceback;
30467 : tstate->exc_type = local_type;
30468 : tstate->exc_value = local_value;
30469 : tstate->exc_traceback = local_tb;
30470 : #endif
30471 0 : Py_XDECREF(tmp_type);
30472 0 : Py_XDECREF(tmp_value);
30473 0 : Py_XDECREF(tmp_tb);
30474 : #else
30475 : PyErr_SetExcInfo(local_type, local_value, local_tb);
30476 : #endif
30477 0 : return 0;
30478 0 : bad:
30479 0 : *type = 0;
30480 0 : *value = 0;
30481 0 : *tb = 0;
30482 0 : Py_XDECREF(local_type);
30483 0 : Py_XDECREF(local_value);
30484 0 : Py_XDECREF(local_tb);
30485 0 : return -1;
30486 : }
30487 :
30488 : /* SwapException */
30489 : #if CYTHON_FAST_THREAD_STATE
30490 0 : static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
30491 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
30492 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
30493 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
30494 0 : tmp_value = exc_info->exc_value;
30495 0 : exc_info->exc_value = *value;
30496 0 : if (tmp_value == NULL || tmp_value == Py_None) {
30497 0 : Py_XDECREF(tmp_value);
30498 0 : tmp_value = NULL;
30499 0 : tmp_type = NULL;
30500 0 : tmp_tb = NULL;
30501 : } else {
30502 0 : tmp_type = (PyObject*) Py_TYPE(tmp_value);
30503 0 : Py_INCREF(tmp_type);
30504 : #if CYTHON_COMPILING_IN_CPYTHON
30505 0 : tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
30506 0 : Py_XINCREF(tmp_tb);
30507 : #else
30508 : tmp_tb = PyException_GetTraceback(tmp_value);
30509 : #endif
30510 : }
30511 : #elif CYTHON_USE_EXC_INFO_STACK
30512 : _PyErr_StackItem *exc_info = tstate->exc_info;
30513 : tmp_type = exc_info->exc_type;
30514 : tmp_value = exc_info->exc_value;
30515 : tmp_tb = exc_info->exc_traceback;
30516 : exc_info->exc_type = *type;
30517 : exc_info->exc_value = *value;
30518 : exc_info->exc_traceback = *tb;
30519 : #else
30520 : tmp_type = tstate->exc_type;
30521 : tmp_value = tstate->exc_value;
30522 : tmp_tb = tstate->exc_traceback;
30523 : tstate->exc_type = *type;
30524 : tstate->exc_value = *value;
30525 : tstate->exc_traceback = *tb;
30526 : #endif
30527 0 : *type = tmp_type;
30528 0 : *value = tmp_value;
30529 0 : *tb = tmp_tb;
30530 0 : }
30531 : #else
30532 : static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
30533 : PyObject *tmp_type, *tmp_value, *tmp_tb;
30534 : PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
30535 : PyErr_SetExcInfo(*type, *value, *tb);
30536 : *type = tmp_type;
30537 : *value = tmp_value;
30538 : *tb = tmp_tb;
30539 : }
30540 : #endif
30541 :
30542 : /* Import */
30543 2 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
30544 2 : PyObject *module = 0;
30545 2 : PyObject *empty_dict = 0;
30546 2 : PyObject *empty_list = 0;
30547 : #if PY_MAJOR_VERSION < 3
30548 : PyObject *py_import;
30549 : py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
30550 : if (unlikely(!py_import))
30551 : goto bad;
30552 : if (!from_list) {
30553 : empty_list = PyList_New(0);
30554 : if (unlikely(!empty_list))
30555 : goto bad;
30556 : from_list = empty_list;
30557 : }
30558 : #endif
30559 2 : empty_dict = PyDict_New();
30560 2 : if (unlikely(!empty_dict))
30561 0 : goto bad;
30562 : {
30563 : #if PY_MAJOR_VERSION >= 3
30564 2 : if (level == -1) {
30565 0 : if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
30566 0 : module = PyImport_ImportModuleLevelObject(
30567 0 : name, __pyx_d, empty_dict, from_list, 1);
30568 0 : if (unlikely(!module)) {
30569 0 : if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
30570 0 : goto bad;
30571 0 : PyErr_Clear();
30572 : }
30573 : }
30574 0 : level = 0;
30575 : }
30576 : #endif
30577 0 : if (!module) {
30578 : #if PY_MAJOR_VERSION < 3
30579 : PyObject *py_level = PyInt_FromLong(level);
30580 : if (unlikely(!py_level))
30581 : goto bad;
30582 : module = PyObject_CallFunctionObjArgs(py_import,
30583 : name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
30584 : Py_DECREF(py_level);
30585 : #else
30586 2 : module = PyImport_ImportModuleLevelObject(
30587 2 : name, __pyx_d, empty_dict, from_list, level);
30588 : #endif
30589 : }
30590 : }
30591 2 : bad:
30592 2 : Py_XDECREF(empty_dict);
30593 2 : Py_XDECREF(empty_list);
30594 : #if PY_MAJOR_VERSION < 3
30595 : Py_XDECREF(py_import);
30596 : #endif
30597 2 : return module;
30598 : }
30599 :
30600 : /* ImportDottedModule */
30601 : #if PY_MAJOR_VERSION >= 3
30602 0 : static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
30603 0 : PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
30604 0 : if (unlikely(PyErr_Occurred())) {
30605 0 : PyErr_Clear();
30606 : }
30607 0 : if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
30608 : partial_name = name;
30609 : } else {
30610 0 : slice = PySequence_GetSlice(parts_tuple, 0, count);
30611 0 : if (unlikely(!slice))
30612 0 : goto bad;
30613 0 : sep = PyUnicode_FromStringAndSize(".", 1);
30614 0 : if (unlikely(!sep))
30615 0 : goto bad;
30616 0 : partial_name = PyUnicode_Join(sep, slice);
30617 : }
30618 0 : PyErr_Format(
30619 : #if PY_MAJOR_VERSION < 3
30620 : PyExc_ImportError,
30621 : "No module named '%s'", PyString_AS_STRING(partial_name));
30622 : #else
30623 : #if PY_VERSION_HEX >= 0x030600B1
30624 : PyExc_ModuleNotFoundError,
30625 : #else
30626 : PyExc_ImportError,
30627 : #endif
30628 : "No module named '%U'", partial_name);
30629 : #endif
30630 0 : bad:
30631 0 : Py_XDECREF(sep);
30632 0 : Py_XDECREF(slice);
30633 0 : Py_XDECREF(partial_name);
30634 0 : return NULL;
30635 : }
30636 : #endif
30637 : #if PY_MAJOR_VERSION >= 3
30638 2 : static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
30639 2 : PyObject *imported_module;
30640 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
30641 : PyObject *modules = PyImport_GetModuleDict();
30642 : if (unlikely(!modules))
30643 : return NULL;
30644 : imported_module = __Pyx_PyDict_GetItemStr(modules, name);
30645 : Py_XINCREF(imported_module);
30646 : #else
30647 4 : imported_module = PyImport_GetModule(name);
30648 : #endif
30649 2 : return imported_module;
30650 : }
30651 : #endif
30652 : #if PY_MAJOR_VERSION >= 3
30653 0 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
30654 0 : Py_ssize_t i, nparts;
30655 0 : nparts = PyTuple_GET_SIZE(parts_tuple);
30656 0 : for (i=1; i < nparts && module; i++) {
30657 0 : PyObject *part, *submodule;
30658 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30659 0 : part = PyTuple_GET_ITEM(parts_tuple, i);
30660 : #else
30661 : part = PySequence_ITEM(parts_tuple, i);
30662 : #endif
30663 0 : submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
30664 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
30665 : Py_DECREF(part);
30666 : #endif
30667 0 : Py_DECREF(module);
30668 0 : module = submodule;
30669 : }
30670 0 : if (unlikely(!module)) {
30671 0 : return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
30672 : }
30673 : return module;
30674 : }
30675 : #endif
30676 0 : static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
30677 : #if PY_MAJOR_VERSION < 3
30678 : PyObject *module, *from_list, *star = __pyx_n_s__3;
30679 : CYTHON_UNUSED_VAR(parts_tuple);
30680 : from_list = PyList_New(1);
30681 : if (unlikely(!from_list))
30682 : return NULL;
30683 : Py_INCREF(star);
30684 : PyList_SET_ITEM(from_list, 0, star);
30685 : module = __Pyx_Import(name, from_list, 0);
30686 : Py_DECREF(from_list);
30687 : return module;
30688 : #else
30689 0 : PyObject *imported_module;
30690 0 : PyObject *module = __Pyx_Import(name, NULL, 0);
30691 0 : if (!parts_tuple || unlikely(!module))
30692 : return module;
30693 0 : imported_module = __Pyx__ImportDottedModule_Lookup(name);
30694 0 : if (likely(imported_module)) {
30695 0 : Py_DECREF(module);
30696 0 : return imported_module;
30697 : }
30698 0 : PyErr_Clear();
30699 0 : return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
30700 : #endif
30701 : }
30702 2 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
30703 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
30704 2 : PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
30705 2 : if (likely(module)) {
30706 2 : PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
30707 2 : if (likely(spec)) {
30708 2 : PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
30709 2 : if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
30710 2 : Py_DECREF(spec);
30711 : spec = NULL;
30712 : }
30713 2 : Py_XDECREF(unsafe);
30714 : }
30715 2 : if (likely(!spec)) {
30716 2 : PyErr_Clear();
30717 2 : return module;
30718 : }
30719 0 : Py_DECREF(spec);
30720 0 : Py_DECREF(module);
30721 0 : } else if (PyErr_Occurred()) {
30722 0 : PyErr_Clear();
30723 : }
30724 : #endif
30725 0 : return __Pyx__ImportDottedModule(name, parts_tuple);
30726 : }
30727 :
30728 : /* FastTypeChecks */
30729 : #if CYTHON_COMPILING_IN_CPYTHON
30730 : static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
30731 0 : while (a) {
30732 0 : a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
30733 0 : if (a == b)
30734 : return 1;
30735 : }
30736 0 : return b == &PyBaseObject_Type;
30737 : }
30738 1964 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
30739 1964 : PyObject *mro;
30740 1964 : if (a == b) return 1;
30741 1964 : mro = a->tp_mro;
30742 1964 : if (likely(mro)) {
30743 1964 : Py_ssize_t i, n;
30744 1964 : n = PyTuple_GET_SIZE(mro);
30745 5892 : for (i = 0; i < n; i++) {
30746 3928 : if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
30747 : return 1;
30748 : }
30749 : return 0;
30750 : }
30751 1964 : return __Pyx_InBases(a, b);
30752 : }
30753 1306 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
30754 1306 : PyObject *mro;
30755 1306 : if (cls == a || cls == b) return 1;
30756 991 : mro = cls->tp_mro;
30757 991 : if (likely(mro)) {
30758 991 : Py_ssize_t i, n;
30759 991 : n = PyTuple_GET_SIZE(mro);
30760 2973 : for (i = 0; i < n; i++) {
30761 1982 : PyObject *base = PyTuple_GET_ITEM(mro, i);
30762 1982 : if (base == (PyObject *)a || base == (PyObject *)b)
30763 : return 1;
30764 : }
30765 : return 0;
30766 : }
30767 0 : return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
30768 : }
30769 : #if PY_MAJOR_VERSION == 2
30770 : static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
30771 : PyObject *exception, *value, *tb;
30772 : int res;
30773 : __Pyx_PyThreadState_declare
30774 : __Pyx_PyThreadState_assign
30775 : __Pyx_ErrFetch(&exception, &value, &tb);
30776 : res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
30777 : if (unlikely(res == -1)) {
30778 : PyErr_WriteUnraisable(err);
30779 : res = 0;
30780 : }
30781 : if (!res) {
30782 : res = PyObject_IsSubclass(err, exc_type2);
30783 : if (unlikely(res == -1)) {
30784 : PyErr_WriteUnraisable(err);
30785 : res = 0;
30786 : }
30787 : }
30788 : __Pyx_ErrRestore(exception, value, tb);
30789 : return res;
30790 : }
30791 : #else
30792 0 : static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
30793 0 : if (exc_type1) {
30794 : return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
30795 : } else {
30796 0 : return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
30797 : }
30798 : }
30799 : #endif
30800 0 : static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
30801 0 : Py_ssize_t i, n;
30802 0 : assert(PyExceptionClass_Check(exc_type));
30803 0 : n = PyTuple_GET_SIZE(tuple);
30804 : #if PY_MAJOR_VERSION >= 3
30805 0 : for (i=0; i<n; i++) {
30806 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
30807 : }
30808 : #endif
30809 0 : for (i=0; i<n; i++) {
30810 0 : PyObject *t = PyTuple_GET_ITEM(tuple, i);
30811 : #if PY_MAJOR_VERSION < 3
30812 : if (likely(exc_type == t)) return 1;
30813 : #endif
30814 0 : if (likely(PyExceptionClass_Check(t))) {
30815 0 : if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
30816 : } else {
30817 0 : }
30818 : }
30819 : return 0;
30820 : }
30821 0 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
30822 0 : if (likely(err == exc_type)) return 1;
30823 0 : if (likely(PyExceptionClass_Check(err))) {
30824 0 : if (likely(PyExceptionClass_Check(exc_type))) {
30825 0 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
30826 0 : } else if (likely(PyTuple_Check(exc_type))) {
30827 0 : return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
30828 : } else {
30829 0 : }
30830 : }
30831 0 : return PyErr_GivenExceptionMatches(err, exc_type);
30832 : }
30833 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
30834 : assert(PyExceptionClass_Check(exc_type1));
30835 : assert(PyExceptionClass_Check(exc_type2));
30836 : if (likely(err == exc_type1 || err == exc_type2)) return 1;
30837 : if (likely(PyExceptionClass_Check(err))) {
30838 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
30839 : }
30840 : return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
30841 : }
30842 : #endif
30843 :
30844 : /* PySequenceMultiply */
30845 0 : static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
30846 0 : PyObject *result, *pymul = PyInt_FromSsize_t(mul);
30847 0 : if (unlikely(!pymul))
30848 : return NULL;
30849 0 : result = PyNumber_Multiply(seq, pymul);
30850 0 : Py_DECREF(pymul);
30851 : return result;
30852 : }
30853 0 : static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
30854 : #if CYTHON_USE_TYPE_SLOTS
30855 0 : PyTypeObject *type = Py_TYPE(seq);
30856 0 : if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
30857 0 : return type->tp_as_sequence->sq_repeat(seq, mul);
30858 : } else
30859 : #endif
30860 : {
30861 0 : return __Pyx_PySequence_Multiply_Generic(seq, mul);
30862 : }
30863 : }
30864 :
30865 : /* SetItemInt */
30866 0 : static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
30867 0 : int r;
30868 0 : if (unlikely(!j)) return -1;
30869 0 : r = PyObject_SetItem(o, j, v);
30870 0 : Py_DECREF(j);
30871 : return r;
30872 : }
30873 0 : static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
30874 : CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
30875 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
30876 0 : if (is_list || PyList_CheckExact(o)) {
30877 0 : Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
30878 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
30879 0 : PyObject* old = PyList_GET_ITEM(o, n);
30880 0 : Py_INCREF(v);
30881 0 : PyList_SET_ITEM(o, n, v);
30882 0 : Py_DECREF(old);
30883 0 : return 1;
30884 : }
30885 : } else {
30886 0 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
30887 0 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
30888 0 : if (mm && mm->mp_ass_subscript) {
30889 0 : int r;
30890 0 : PyObject *key = PyInt_FromSsize_t(i);
30891 0 : if (unlikely(!key)) return -1;
30892 0 : r = mm->mp_ass_subscript(o, key, v);
30893 0 : Py_DECREF(key);
30894 0 : return r;
30895 : }
30896 0 : if (likely(sm && sm->sq_ass_item)) {
30897 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
30898 0 : Py_ssize_t l = sm->sq_length(o);
30899 0 : if (likely(l >= 0)) {
30900 0 : i += l;
30901 : } else {
30902 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
30903 : return -1;
30904 0 : PyErr_Clear();
30905 : }
30906 : }
30907 0 : return sm->sq_ass_item(o, i, v);
30908 : }
30909 : }
30910 : #else
30911 : if (is_list || !PyMapping_Check(o))
30912 : {
30913 : return PySequence_SetItem(o, i, v);
30914 : }
30915 : #endif
30916 0 : return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
30917 : }
30918 :
30919 : /* RaiseUnboundLocalError */
30920 0 : static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
30921 0 : PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
30922 : }
30923 :
30924 : /* DivInt[long] */
30925 0 : static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
30926 0 : long q = a / b;
30927 0 : long r = a - q*b;
30928 0 : q -= ((r != 0) & ((r ^ b) < 0));
30929 0 : return q;
30930 : }
30931 :
30932 : /* ImportFrom */
30933 2 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
30934 2 : PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
30935 2 : if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
30936 0 : const char* module_name_str = 0;
30937 0 : PyObject* module_name = 0;
30938 0 : PyObject* module_dot = 0;
30939 0 : PyObject* full_name = 0;
30940 0 : PyErr_Clear();
30941 0 : module_name_str = PyModule_GetName(module);
30942 0 : if (unlikely(!module_name_str)) { goto modbad; }
30943 0 : module_name = PyUnicode_FromString(module_name_str);
30944 0 : if (unlikely(!module_name)) { goto modbad; }
30945 0 : module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2);
30946 0 : if (unlikely(!module_dot)) { goto modbad; }
30947 0 : full_name = PyUnicode_Concat(module_dot, name);
30948 0 : if (unlikely(!full_name)) { goto modbad; }
30949 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
30950 : {
30951 : PyObject *modules = PyImport_GetModuleDict();
30952 : if (unlikely(!modules))
30953 : goto modbad;
30954 : value = PyObject_GetItem(modules, full_name);
30955 : }
30956 : #else
30957 0 : value = PyImport_GetModule(full_name);
30958 : #endif
30959 0 : modbad:
30960 0 : Py_XDECREF(full_name);
30961 0 : Py_XDECREF(module_dot);
30962 0 : Py_XDECREF(module_name);
30963 : }
30964 2 : if (unlikely(!value)) {
30965 0 : PyErr_Format(PyExc_ImportError,
30966 : #if PY_MAJOR_VERSION < 3
30967 : "cannot import name %.230s", PyString_AS_STRING(name));
30968 : #else
30969 : "cannot import name %S", name);
30970 : #endif
30971 : }
30972 2 : return value;
30973 : }
30974 :
30975 : /* HasAttr */
30976 0 : static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
30977 0 : PyObject *r;
30978 0 : if (unlikely(!__Pyx_PyBaseString_Check(n))) {
30979 0 : PyErr_SetString(PyExc_TypeError,
30980 : "hasattr(): attribute name must be string");
30981 0 : return -1;
30982 : }
30983 0 : r = __Pyx_GetAttr(o, n);
30984 0 : if (!r) {
30985 0 : PyErr_Clear();
30986 0 : return 0;
30987 : } else {
30988 0 : Py_DECREF(r);
30989 0 : return 1;
30990 : }
30991 : }
30992 :
30993 : /* IterFinish */
30994 0 : static CYTHON_INLINE int __Pyx_IterFinish(void) {
30995 0 : PyObject* exc_type;
30996 0 : __Pyx_PyThreadState_declare
30997 0 : __Pyx_PyThreadState_assign
30998 0 : exc_type = __Pyx_PyErr_CurrentExceptionType();
30999 0 : if (unlikely(exc_type)) {
31000 0 : if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
31001 : return -1;
31002 0 : __Pyx_PyErr_Clear();
31003 0 : return 0;
31004 : }
31005 : return 0;
31006 : }
31007 :
31008 : /* UnpackItemEndCheck */
31009 0 : static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
31010 0 : if (unlikely(retval)) {
31011 0 : Py_DECREF(retval);
31012 0 : __Pyx_RaiseTooManyValuesError(expected);
31013 0 : return -1;
31014 : }
31015 0 : return __Pyx_IterFinish();
31016 : }
31017 :
31018 : /* PyObjectFormatAndDecref */
31019 0 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
31020 0 : if (unlikely(!s)) return NULL;
31021 0 : if (likely(PyUnicode_CheckExact(s))) return s;
31022 : #if PY_MAJOR_VERSION < 3
31023 : if (likely(PyString_CheckExact(s))) {
31024 : PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
31025 : Py_DECREF(s);
31026 : return result;
31027 : }
31028 : #endif
31029 0 : return __Pyx_PyObject_FormatAndDecref(s, f);
31030 : }
31031 0 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
31032 0 : PyObject *result;
31033 0 : if (unlikely(!s)) return NULL;
31034 0 : result = PyObject_Format(s, f);
31035 0 : Py_DECREF(s);
31036 : return result;
31037 : }
31038 :
31039 : /* PyIntCompare */
31040 111 : static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
31041 111 : CYTHON_MAYBE_UNUSED_VAR(intval);
31042 111 : CYTHON_UNUSED_VAR(inplace);
31043 111 : if (op1 == op2) {
31044 : Py_RETURN_FALSE;
31045 : }
31046 : #if PY_MAJOR_VERSION < 3
31047 : if (likely(PyInt_CheckExact(op1))) {
31048 : const long b = intval;
31049 : long a = PyInt_AS_LONG(op1);
31050 : if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
31051 : }
31052 : #endif
31053 : #if CYTHON_USE_PYLONG_INTERNALS
31054 111 : if (likely(PyLong_CheckExact(op1))) {
31055 0 : int unequal;
31056 0 : unsigned long uintval;
31057 0 : Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
31058 0 : const digit* digits = __Pyx_PyLong_Digits(op1);
31059 0 : if (intval == 0) {
31060 0 : if (__Pyx_PyLong_IsZero(op1) != 1) Py_RETURN_TRUE; else Py_RETURN_FALSE;
31061 0 : } else if (intval < 0) {
31062 0 : if (__Pyx_PyLong_IsNonNeg(op1))
31063 : Py_RETURN_TRUE;
31064 0 : intval = -intval;
31065 : } else {
31066 0 : if (__Pyx_PyLong_IsNeg(op1))
31067 : Py_RETURN_TRUE;
31068 : }
31069 0 : uintval = (unsigned long) intval;
31070 : #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
31071 : if (uintval >> (PyLong_SHIFT * 4)) {
31072 : unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
31073 : | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
31074 : } else
31075 : #endif
31076 : #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
31077 : if (uintval >> (PyLong_SHIFT * 3)) {
31078 : unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
31079 : | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
31080 : } else
31081 : #endif
31082 : #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
31083 0 : if (uintval >> (PyLong_SHIFT * 2)) {
31084 0 : unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
31085 0 : | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
31086 : } else
31087 : #endif
31088 : #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
31089 0 : if (uintval >> (PyLong_SHIFT * 1)) {
31090 0 : unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
31091 0 : | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
31092 : } else
31093 : #endif
31094 0 : unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
31095 0 : if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
31096 : }
31097 : #endif
31098 111 : if (PyFloat_CheckExact(op1)) {
31099 0 : const long b = intval;
31100 : #if CYTHON_COMPILING_IN_LIMITED_API
31101 : double a = __pyx_PyFloat_AsDouble(op1);
31102 : #else
31103 0 : double a = PyFloat_AS_DOUBLE(op1);
31104 : #endif
31105 0 : if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
31106 : }
31107 111 : return (
31108 111 : PyObject_RichCompare(op1, op2, Py_NE));
31109 : }
31110 :
31111 : /* PyObject_GenericGetAttrNoDict */
31112 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
31113 : static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
31114 : __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
31115 : PyErr_Format(PyExc_AttributeError,
31116 : #if PY_MAJOR_VERSION >= 3
31117 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
31118 : type_name, attr_name);
31119 : #else
31120 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
31121 : type_name, PyString_AS_STRING(attr_name));
31122 : #endif
31123 : __Pyx_DECREF_TypeName(type_name);
31124 : return NULL;
31125 : }
31126 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
31127 : PyObject *descr;
31128 : PyTypeObject *tp = Py_TYPE(obj);
31129 : if (unlikely(!PyString_Check(attr_name))) {
31130 : return PyObject_GenericGetAttr(obj, attr_name);
31131 : }
31132 : assert(!tp->tp_dictoffset);
31133 : descr = _PyType_Lookup(tp, attr_name);
31134 : if (unlikely(!descr)) {
31135 : return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
31136 : }
31137 : Py_INCREF(descr);
31138 : #if PY_MAJOR_VERSION < 3
31139 : if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
31140 : #endif
31141 : {
31142 : descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
31143 : if (unlikely(f)) {
31144 : PyObject *res = f(descr, obj, (PyObject *)tp);
31145 : Py_DECREF(descr);
31146 : return res;
31147 : }
31148 : }
31149 : return descr;
31150 : }
31151 : #endif
31152 :
31153 : /* PyObject_GenericGetAttr */
31154 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
31155 : static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
31156 : if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
31157 : return PyObject_GenericGetAttr(obj, attr_name);
31158 : }
31159 : return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
31160 : }
31161 : #endif
31162 :
31163 : /* FixUpExtensionType */
31164 : #if CYTHON_USE_TYPE_SPECS
31165 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
31166 : #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
31167 : CYTHON_UNUSED_VAR(spec);
31168 : CYTHON_UNUSED_VAR(type);
31169 : #else
31170 : const PyType_Slot *slot = spec->slots;
31171 : while (slot && slot->slot && slot->slot != Py_tp_members)
31172 : slot++;
31173 : if (slot && slot->slot == Py_tp_members) {
31174 : int changed = 0;
31175 : #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
31176 : const
31177 : #endif
31178 : PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
31179 : while (memb && memb->name) {
31180 : if (memb->name[0] == '_' && memb->name[1] == '_') {
31181 : #if PY_VERSION_HEX < 0x030900b1
31182 : if (strcmp(memb->name, "__weaklistoffset__") == 0) {
31183 : assert(memb->type == T_PYSSIZET);
31184 : assert(memb->flags == READONLY);
31185 : type->tp_weaklistoffset = memb->offset;
31186 : changed = 1;
31187 : }
31188 : else if (strcmp(memb->name, "__dictoffset__") == 0) {
31189 : assert(memb->type == T_PYSSIZET);
31190 : assert(memb->flags == READONLY);
31191 : type->tp_dictoffset = memb->offset;
31192 : changed = 1;
31193 : }
31194 : #if CYTHON_METH_FASTCALL
31195 : else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
31196 : assert(memb->type == T_PYSSIZET);
31197 : assert(memb->flags == READONLY);
31198 : #if PY_VERSION_HEX >= 0x030800b4
31199 : type->tp_vectorcall_offset = memb->offset;
31200 : #else
31201 : type->tp_print = (printfunc) memb->offset;
31202 : #endif
31203 : changed = 1;
31204 : }
31205 : #endif
31206 : #else
31207 : if ((0));
31208 : #endif
31209 : #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
31210 : else if (strcmp(memb->name, "__module__") == 0) {
31211 : PyObject *descr;
31212 : assert(memb->type == T_OBJECT);
31213 : assert(memb->flags == 0 || memb->flags == READONLY);
31214 : descr = PyDescr_NewMember(type, memb);
31215 : if (unlikely(!descr))
31216 : return -1;
31217 : if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
31218 : Py_DECREF(descr);
31219 : return -1;
31220 : }
31221 : Py_DECREF(descr);
31222 : changed = 1;
31223 : }
31224 : #endif
31225 : }
31226 : memb++;
31227 : }
31228 : if (changed)
31229 : PyType_Modified(type);
31230 : }
31231 : #endif
31232 : return 0;
31233 : }
31234 : #endif
31235 :
31236 : /* PyObjectCallNoArg */
31237 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
31238 : PyObject *arg[2] = {NULL, NULL};
31239 : return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
31240 : }
31241 :
31242 : /* PyObjectGetMethod */
31243 : static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
31244 : PyObject *attr;
31245 : #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
31246 : __Pyx_TypeName type_name;
31247 : PyTypeObject *tp = Py_TYPE(obj);
31248 : PyObject *descr;
31249 : descrgetfunc f = NULL;
31250 : PyObject **dictptr, *dict;
31251 : int meth_found = 0;
31252 : assert (*method == NULL);
31253 : if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
31254 : attr = __Pyx_PyObject_GetAttrStr(obj, name);
31255 : goto try_unpack;
31256 : }
31257 : if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
31258 : return 0;
31259 : }
31260 : descr = _PyType_Lookup(tp, name);
31261 : if (likely(descr != NULL)) {
31262 : Py_INCREF(descr);
31263 : #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
31264 : if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
31265 : #elif PY_MAJOR_VERSION >= 3
31266 : #ifdef __Pyx_CyFunction_USED
31267 : if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
31268 : #else
31269 : if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
31270 : #endif
31271 : #else
31272 : #ifdef __Pyx_CyFunction_USED
31273 : if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
31274 : #else
31275 : if (likely(PyFunction_Check(descr)))
31276 : #endif
31277 : #endif
31278 : {
31279 : meth_found = 1;
31280 : } else {
31281 : f = Py_TYPE(descr)->tp_descr_get;
31282 : if (f != NULL && PyDescr_IsData(descr)) {
31283 : attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
31284 : Py_DECREF(descr);
31285 : goto try_unpack;
31286 : }
31287 : }
31288 : }
31289 : dictptr = _PyObject_GetDictPtr(obj);
31290 : if (dictptr != NULL && (dict = *dictptr) != NULL) {
31291 : Py_INCREF(dict);
31292 : attr = __Pyx_PyDict_GetItemStr(dict, name);
31293 : if (attr != NULL) {
31294 : Py_INCREF(attr);
31295 : Py_DECREF(dict);
31296 : Py_XDECREF(descr);
31297 : goto try_unpack;
31298 : }
31299 : Py_DECREF(dict);
31300 : }
31301 : if (meth_found) {
31302 : *method = descr;
31303 : return 1;
31304 : }
31305 : if (f != NULL) {
31306 : attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
31307 : Py_DECREF(descr);
31308 : goto try_unpack;
31309 : }
31310 : if (likely(descr != NULL)) {
31311 : *method = descr;
31312 : return 0;
31313 : }
31314 : type_name = __Pyx_PyType_GetName(tp);
31315 : PyErr_Format(PyExc_AttributeError,
31316 : #if PY_MAJOR_VERSION >= 3
31317 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
31318 : type_name, name);
31319 : #else
31320 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
31321 : type_name, PyString_AS_STRING(name));
31322 : #endif
31323 : __Pyx_DECREF_TypeName(type_name);
31324 : return 0;
31325 : #else
31326 : attr = __Pyx_PyObject_GetAttrStr(obj, name);
31327 : goto try_unpack;
31328 : #endif
31329 : try_unpack:
31330 : #if CYTHON_UNPACK_METHODS
31331 : if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
31332 : PyObject *function = PyMethod_GET_FUNCTION(attr);
31333 : Py_INCREF(function);
31334 : Py_DECREF(attr);
31335 : *method = function;
31336 : return 1;
31337 : }
31338 : #endif
31339 : *method = attr;
31340 : return 0;
31341 : }
31342 :
31343 : /* PyObjectCallMethod0 */
31344 : static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
31345 : PyObject *method = NULL, *result = NULL;
31346 : int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
31347 : if (likely(is_method)) {
31348 : result = __Pyx_PyObject_CallOneArg(method, obj);
31349 : Py_DECREF(method);
31350 : return result;
31351 : }
31352 : if (unlikely(!method)) goto bad;
31353 : result = __Pyx_PyObject_CallNoArg(method);
31354 : Py_DECREF(method);
31355 : bad:
31356 : return result;
31357 : }
31358 :
31359 : /* ValidateBasesTuple */
31360 : #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
31361 0 : static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
31362 0 : Py_ssize_t i, n;
31363 : #if CYTHON_ASSUME_SAFE_MACROS
31364 0 : n = PyTuple_GET_SIZE(bases);
31365 : #else
31366 : n = PyTuple_Size(bases);
31367 : if (n < 0) return -1;
31368 : #endif
31369 0 : for (i = 1; i < n; i++)
31370 : {
31371 : #if CYTHON_AVOID_BORROWED_REFS
31372 : PyObject *b0 = PySequence_GetItem(bases, i);
31373 : if (!b0) return -1;
31374 : #elif CYTHON_ASSUME_SAFE_MACROS
31375 0 : PyObject *b0 = PyTuple_GET_ITEM(bases, i);
31376 : #else
31377 : PyObject *b0 = PyTuple_GetItem(bases, i);
31378 : if (!b0) return -1;
31379 : #endif
31380 0 : PyTypeObject *b;
31381 : #if PY_MAJOR_VERSION < 3
31382 : if (PyClass_Check(b0))
31383 : {
31384 : PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
31385 : PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
31386 : #if CYTHON_AVOID_BORROWED_REFS
31387 : Py_DECREF(b0);
31388 : #endif
31389 : return -1;
31390 : }
31391 : #endif
31392 0 : b = (PyTypeObject*) b0;
31393 0 : if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
31394 : {
31395 0 : __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
31396 0 : PyErr_Format(PyExc_TypeError,
31397 : "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
31398 0 : __Pyx_DECREF_TypeName(b_name);
31399 : #if CYTHON_AVOID_BORROWED_REFS
31400 : Py_DECREF(b0);
31401 : #endif
31402 0 : return -1;
31403 : }
31404 0 : if (dictoffset == 0)
31405 : {
31406 0 : Py_ssize_t b_dictoffset = 0;
31407 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
31408 0 : b_dictoffset = b->tp_dictoffset;
31409 : #else
31410 : PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
31411 : if (!py_b_dictoffset) goto dictoffset_return;
31412 : b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
31413 : Py_DECREF(py_b_dictoffset);
31414 : if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
31415 : #endif
31416 0 : if (b_dictoffset) {
31417 : {
31418 0 : __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
31419 0 : PyErr_Format(PyExc_TypeError,
31420 : "extension type '%.200s' has no __dict__ slot, "
31421 : "but base type '" __Pyx_FMT_TYPENAME "' has: "
31422 : "either add 'cdef dict __dict__' to the extension type "
31423 : "or add '__slots__ = [...]' to the base type",
31424 : type_name, b_name);
31425 0 : __Pyx_DECREF_TypeName(b_name);
31426 : }
31427 : #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
31428 : dictoffset_return:
31429 : #endif
31430 : #if CYTHON_AVOID_BORROWED_REFS
31431 : Py_DECREF(b0);
31432 : #endif
31433 0 : return -1;
31434 : }
31435 : }
31436 : #if CYTHON_AVOID_BORROWED_REFS
31437 : Py_DECREF(b0);
31438 : #endif
31439 : }
31440 : return 0;
31441 : }
31442 : #endif
31443 :
31444 : /* PyType_Ready */
31445 4 : static int __Pyx_PyType_Ready(PyTypeObject *t) {
31446 : #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
31447 : (void)__Pyx_PyObject_CallMethod0;
31448 : #if CYTHON_USE_TYPE_SPECS
31449 : (void)__Pyx_validate_bases_tuple;
31450 : #endif
31451 : return PyType_Ready(t);
31452 : #else
31453 4 : int r;
31454 4 : PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
31455 4 : if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
31456 : return -1;
31457 : #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
31458 : {
31459 4 : int gc_was_enabled;
31460 : #if PY_VERSION_HEX >= 0x030A00b1
31461 4 : gc_was_enabled = PyGC_Disable();
31462 4 : (void)__Pyx_PyObject_CallMethod0;
31463 : #else
31464 : PyObject *ret, *py_status;
31465 : PyObject *gc = NULL;
31466 : #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
31467 : gc = PyImport_GetModule(__pyx_kp_u_gc);
31468 : #endif
31469 : if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
31470 : if (unlikely(!gc)) return -1;
31471 : py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
31472 : if (unlikely(!py_status)) {
31473 : Py_DECREF(gc);
31474 : return -1;
31475 : }
31476 : gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
31477 : Py_DECREF(py_status);
31478 : if (gc_was_enabled > 0) {
31479 : ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
31480 : if (unlikely(!ret)) {
31481 : Py_DECREF(gc);
31482 : return -1;
31483 : }
31484 : Py_DECREF(ret);
31485 : } else if (unlikely(gc_was_enabled == -1)) {
31486 : Py_DECREF(gc);
31487 : return -1;
31488 : }
31489 : #endif
31490 4 : t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
31491 : #if PY_VERSION_HEX >= 0x030A0000
31492 4 : t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
31493 : #endif
31494 : #else
31495 : (void)__Pyx_PyObject_CallMethod0;
31496 : #endif
31497 4 : r = PyType_Ready(t);
31498 : #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
31499 4 : t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
31500 : #if PY_VERSION_HEX >= 0x030A00b1
31501 4 : if (gc_was_enabled)
31502 4 : PyGC_Enable();
31503 : #else
31504 : if (gc_was_enabled) {
31505 : PyObject *tp, *v, *tb;
31506 : PyErr_Fetch(&tp, &v, &tb);
31507 : ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
31508 : if (likely(ret || r == -1)) {
31509 : Py_XDECREF(ret);
31510 : PyErr_Restore(tp, v, tb);
31511 : } else {
31512 : Py_XDECREF(tp);
31513 : Py_XDECREF(v);
31514 : Py_XDECREF(tb);
31515 : r = -1;
31516 : }
31517 : }
31518 : Py_DECREF(gc);
31519 : #endif
31520 : }
31521 : #endif
31522 : return r;
31523 : #endif
31524 : }
31525 :
31526 : /* SetVTable */
31527 3 : static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
31528 3 : PyObject *ob = PyCapsule_New(vtable, 0, 0);
31529 3 : if (unlikely(!ob))
31530 0 : goto bad;
31531 : #if CYTHON_COMPILING_IN_LIMITED_API
31532 : if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
31533 : #else
31534 3 : if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
31535 : #endif
31536 0 : goto bad;
31537 3 : Py_DECREF(ob);
31538 : return 0;
31539 0 : bad:
31540 0 : Py_XDECREF(ob);
31541 0 : return -1;
31542 : }
31543 :
31544 : /* GetVTable */
31545 0 : static void* __Pyx_GetVtable(PyTypeObject *type) {
31546 0 : void* ptr;
31547 : #if CYTHON_COMPILING_IN_LIMITED_API
31548 : PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
31549 : #else
31550 0 : PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
31551 : #endif
31552 0 : if (!ob)
31553 0 : goto bad;
31554 0 : ptr = PyCapsule_GetPointer(ob, 0);
31555 0 : if (!ptr && !PyErr_Occurred())
31556 0 : PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
31557 0 : Py_DECREF(ob);
31558 : return ptr;
31559 0 : bad:
31560 0 : Py_XDECREF(ob);
31561 0 : return NULL;
31562 : }
31563 :
31564 : /* MergeVTables */
31565 : #if !CYTHON_COMPILING_IN_LIMITED_API
31566 3 : static int __Pyx_MergeVtables(PyTypeObject *type) {
31567 3 : int i;
31568 3 : void** base_vtables;
31569 3 : __Pyx_TypeName tp_base_name;
31570 3 : __Pyx_TypeName base_name;
31571 3 : void* unknown = (void*)-1;
31572 3 : PyObject* bases = type->tp_bases;
31573 3 : int base_depth = 0;
31574 : {
31575 3 : PyTypeObject* base = type->tp_base;
31576 7 : while (base) {
31577 4 : base_depth += 1;
31578 4 : base = base->tp_base;
31579 : }
31580 : }
31581 3 : base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
31582 3 : base_vtables[0] = unknown;
31583 3 : for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
31584 0 : void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
31585 0 : if (base_vtable != NULL) {
31586 0 : int j;
31587 0 : PyTypeObject* base = type->tp_base;
31588 0 : for (j = 0; j < base_depth; j++) {
31589 0 : if (base_vtables[j] == unknown) {
31590 0 : base_vtables[j] = __Pyx_GetVtable(base);
31591 0 : base_vtables[j + 1] = unknown;
31592 : }
31593 0 : if (base_vtables[j] == base_vtable) {
31594 : break;
31595 0 : } else if (base_vtables[j] == NULL) {
31596 0 : goto bad;
31597 : }
31598 0 : base = base->tp_base;
31599 : }
31600 : }
31601 : }
31602 3 : PyErr_Clear();
31603 3 : free(base_vtables);
31604 3 : return 0;
31605 0 : bad:
31606 0 : tp_base_name = __Pyx_PyType_GetName(type->tp_base);
31607 0 : base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
31608 0 : PyErr_Format(PyExc_TypeError,
31609 : "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
31610 0 : __Pyx_DECREF_TypeName(tp_base_name);
31611 0 : __Pyx_DECREF_TypeName(base_name);
31612 0 : free(base_vtables);
31613 0 : return -1;
31614 : }
31615 : #endif
31616 :
31617 : /* SetupReduce */
31618 : #if !CYTHON_COMPILING_IN_LIMITED_API
31619 2 : static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
31620 2 : int ret;
31621 2 : PyObject *name_attr;
31622 2 : name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2);
31623 2 : if (likely(name_attr)) {
31624 2 : ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
31625 : } else {
31626 : ret = -1;
31627 : }
31628 2 : if (unlikely(ret < 0)) {
31629 0 : PyErr_Clear();
31630 0 : ret = 0;
31631 : }
31632 2 : Py_XDECREF(name_attr);
31633 2 : return ret;
31634 : }
31635 4 : static int __Pyx_setup_reduce(PyObject* type_obj) {
31636 4 : int ret = 0;
31637 4 : PyObject *object_reduce = NULL;
31638 4 : PyObject *object_getstate = NULL;
31639 4 : PyObject *object_reduce_ex = NULL;
31640 4 : PyObject *reduce = NULL;
31641 4 : PyObject *reduce_ex = NULL;
31642 4 : PyObject *reduce_cython = NULL;
31643 4 : PyObject *setstate = NULL;
31644 4 : PyObject *setstate_cython = NULL;
31645 4 : PyObject *getstate = NULL;
31646 : #if CYTHON_USE_PYTYPE_LOOKUP
31647 4 : getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
31648 : #else
31649 : getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
31650 : if (!getstate && PyErr_Occurred()) {
31651 : goto __PYX_BAD;
31652 : }
31653 : #endif
31654 4 : if (getstate) {
31655 : #if CYTHON_USE_PYTYPE_LOOKUP
31656 4 : object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
31657 : #else
31658 : object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
31659 : if (!object_getstate && PyErr_Occurred()) {
31660 : goto __PYX_BAD;
31661 : }
31662 : #endif
31663 4 : if (object_getstate != getstate) {
31664 0 : goto __PYX_GOOD;
31665 : }
31666 : }
31667 : #if CYTHON_USE_PYTYPE_LOOKUP
31668 4 : object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
31669 : #else
31670 : object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
31671 : #endif
31672 4 : reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
31673 4 : if (reduce_ex == object_reduce_ex) {
31674 : #if CYTHON_USE_PYTYPE_LOOKUP
31675 4 : object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
31676 : #else
31677 : object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
31678 : #endif
31679 4 : reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
31680 4 : if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
31681 4 : reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
31682 4 : if (likely(reduce_cython)) {
31683 4 : ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31684 4 : ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31685 0 : } else if (reduce == object_reduce || PyErr_Occurred()) {
31686 0 : goto __PYX_BAD;
31687 : }
31688 4 : setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
31689 4 : if (!setstate) PyErr_Clear();
31690 4 : if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
31691 4 : setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
31692 4 : if (likely(setstate_cython)) {
31693 4 : ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31694 4 : ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31695 0 : } else if (!setstate || PyErr_Occurred()) {
31696 0 : goto __PYX_BAD;
31697 : }
31698 : }
31699 4 : PyType_Modified((PyTypeObject*)type_obj);
31700 : }
31701 : }
31702 4 : goto __PYX_GOOD;
31703 0 : __PYX_BAD:
31704 0 : if (!PyErr_Occurred()) {
31705 0 : __Pyx_TypeName type_obj_name =
31706 : __Pyx_PyType_GetName((PyTypeObject*)type_obj);
31707 0 : PyErr_Format(PyExc_RuntimeError,
31708 : "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
31709 : __Pyx_DECREF_TypeName(type_obj_name);
31710 : }
31711 : ret = -1;
31712 4 : __PYX_GOOD:
31713 : #if !CYTHON_USE_PYTYPE_LOOKUP
31714 : Py_XDECREF(object_reduce);
31715 : Py_XDECREF(object_reduce_ex);
31716 : Py_XDECREF(object_getstate);
31717 : Py_XDECREF(getstate);
31718 : #endif
31719 4 : Py_XDECREF(reduce);
31720 4 : Py_XDECREF(reduce_ex);
31721 4 : Py_XDECREF(reduce_cython);
31722 4 : Py_XDECREF(setstate);
31723 4 : Py_XDECREF(setstate_cython);
31724 4 : return ret;
31725 : }
31726 : #endif
31727 :
31728 : /* TypeImport */
31729 : #ifndef __PYX_HAVE_RT_ImportType_3_0_11
31730 : #define __PYX_HAVE_RT_ImportType_3_0_11
31731 16 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name,
31732 : size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size)
31733 : {
31734 16 : PyObject *result = 0;
31735 16 : char warning[200];
31736 16 : Py_ssize_t basicsize;
31737 16 : Py_ssize_t itemsize;
31738 : #if CYTHON_COMPILING_IN_LIMITED_API
31739 : PyObject *py_basicsize;
31740 : PyObject *py_itemsize;
31741 : #endif
31742 16 : result = PyObject_GetAttrString(module, class_name);
31743 16 : if (!result)
31744 0 : goto bad;
31745 16 : if (!PyType_Check(result)) {
31746 0 : PyErr_Format(PyExc_TypeError,
31747 : "%.200s.%.200s is not a type object",
31748 : module_name, class_name);
31749 0 : goto bad;
31750 : }
31751 : #if !CYTHON_COMPILING_IN_LIMITED_API
31752 16 : basicsize = ((PyTypeObject *)result)->tp_basicsize;
31753 16 : itemsize = ((PyTypeObject *)result)->tp_itemsize;
31754 : #else
31755 : py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
31756 : if (!py_basicsize)
31757 : goto bad;
31758 : basicsize = PyLong_AsSsize_t(py_basicsize);
31759 : Py_DECREF(py_basicsize);
31760 : py_basicsize = 0;
31761 : if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
31762 : goto bad;
31763 : py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
31764 : if (!py_itemsize)
31765 : goto bad;
31766 : itemsize = PyLong_AsSsize_t(py_itemsize);
31767 : Py_DECREF(py_itemsize);
31768 : py_itemsize = 0;
31769 : if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
31770 : goto bad;
31771 : #endif
31772 16 : if (itemsize) {
31773 1 : if (size % alignment) {
31774 0 : alignment = size % alignment;
31775 : }
31776 1 : if (itemsize < (Py_ssize_t)alignment)
31777 : itemsize = (Py_ssize_t)alignment;
31778 : }
31779 16 : if ((size_t)(basicsize + itemsize) < size) {
31780 0 : PyErr_Format(PyExc_ValueError,
31781 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
31782 : "Expected %zd from C header, got %zd from PyObject",
31783 : module_name, class_name, size, basicsize+itemsize);
31784 0 : goto bad;
31785 : }
31786 16 : if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 &&
31787 0 : ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
31788 0 : PyErr_Format(PyExc_ValueError,
31789 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
31790 : "Expected %zd from C header, got %zd-%zd from PyObject",
31791 : module_name, class_name, size, basicsize, basicsize+itemsize);
31792 0 : goto bad;
31793 : }
31794 16 : else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) {
31795 0 : PyOS_snprintf(warning, sizeof(warning),
31796 : "%s.%s size changed, may indicate binary incompatibility. "
31797 : "Expected %zd from C header, got %zd from PyObject",
31798 : module_name, class_name, size, basicsize);
31799 0 : if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
31800 : }
31801 : return (PyTypeObject *)result;
31802 0 : bad:
31803 0 : Py_XDECREF(result);
31804 0 : return NULL;
31805 : }
31806 : #endif
31807 :
31808 : /* FetchSharedCythonModule */
31809 1 : static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
31810 1 : return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
31811 : }
31812 :
31813 : /* FetchCommonType */
31814 1 : static int __Pyx_VerifyCachedType(PyObject *cached_type,
31815 : const char *name,
31816 : Py_ssize_t basicsize,
31817 : Py_ssize_t expected_basicsize) {
31818 1 : if (!PyType_Check(cached_type)) {
31819 0 : PyErr_Format(PyExc_TypeError,
31820 : "Shared Cython type %.200s is not a type object", name);
31821 0 : return -1;
31822 : }
31823 1 : if (basicsize != expected_basicsize) {
31824 0 : PyErr_Format(PyExc_TypeError,
31825 : "Shared Cython type %.200s has the wrong size, try recompiling",
31826 : name);
31827 0 : return -1;
31828 : }
31829 : return 0;
31830 : }
31831 : #if !CYTHON_USE_TYPE_SPECS
31832 1 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
31833 1 : PyObject* abi_module;
31834 1 : const char* object_name;
31835 1 : PyTypeObject *cached_type = NULL;
31836 1 : abi_module = __Pyx_FetchSharedCythonABIModule();
31837 1 : if (!abi_module) return NULL;
31838 1 : object_name = strrchr(type->tp_name, '.');
31839 1 : object_name = object_name ? object_name+1 : type->tp_name;
31840 1 : cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
31841 1 : if (cached_type) {
31842 1 : if (__Pyx_VerifyCachedType(
31843 : (PyObject *)cached_type,
31844 : object_name,
31845 : cached_type->tp_basicsize,
31846 : type->tp_basicsize) < 0) {
31847 0 : goto bad;
31848 : }
31849 1 : goto done;
31850 : }
31851 0 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
31852 0 : PyErr_Clear();
31853 0 : if (PyType_Ready(type) < 0) goto bad;
31854 0 : if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
31855 0 : goto bad;
31856 0 : Py_INCREF(type);
31857 : cached_type = type;
31858 1 : done:
31859 1 : Py_DECREF(abi_module);
31860 : return cached_type;
31861 0 : bad:
31862 0 : Py_XDECREF(cached_type);
31863 0 : cached_type = NULL;
31864 0 : goto done;
31865 : }
31866 : #else
31867 : static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
31868 : PyObject *abi_module, *cached_type = NULL;
31869 : const char* object_name = strrchr(spec->name, '.');
31870 : object_name = object_name ? object_name+1 : spec->name;
31871 : abi_module = __Pyx_FetchSharedCythonABIModule();
31872 : if (!abi_module) return NULL;
31873 : cached_type = PyObject_GetAttrString(abi_module, object_name);
31874 : if (cached_type) {
31875 : Py_ssize_t basicsize;
31876 : #if CYTHON_COMPILING_IN_LIMITED_API
31877 : PyObject *py_basicsize;
31878 : py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
31879 : if (unlikely(!py_basicsize)) goto bad;
31880 : basicsize = PyLong_AsSsize_t(py_basicsize);
31881 : Py_DECREF(py_basicsize);
31882 : py_basicsize = 0;
31883 : if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
31884 : #else
31885 : basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
31886 : #endif
31887 : if (__Pyx_VerifyCachedType(
31888 : cached_type,
31889 : object_name,
31890 : basicsize,
31891 : spec->basicsize) < 0) {
31892 : goto bad;
31893 : }
31894 : goto done;
31895 : }
31896 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
31897 : PyErr_Clear();
31898 : CYTHON_UNUSED_VAR(module);
31899 : cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
31900 : if (unlikely(!cached_type)) goto bad;
31901 : if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
31902 : if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
31903 : done:
31904 : Py_DECREF(abi_module);
31905 : assert(cached_type == NULL || PyType_Check(cached_type));
31906 : return (PyTypeObject *) cached_type;
31907 : bad:
31908 : Py_XDECREF(cached_type);
31909 : cached_type = NULL;
31910 : goto done;
31911 : }
31912 : #endif
31913 :
31914 : /* PyVectorcallFastCallDict */
31915 : #if CYTHON_METH_FASTCALL
31916 0 : static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
31917 : {
31918 0 : PyObject *res = NULL;
31919 0 : PyObject *kwnames;
31920 0 : PyObject **newargs;
31921 0 : PyObject **kwvalues;
31922 0 : Py_ssize_t i, pos;
31923 0 : size_t j;
31924 0 : PyObject *key, *value;
31925 0 : unsigned long keys_are_strings;
31926 0 : Py_ssize_t nkw = PyDict_GET_SIZE(kw);
31927 0 : newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
31928 0 : if (unlikely(newargs == NULL)) {
31929 0 : PyErr_NoMemory();
31930 0 : return NULL;
31931 : }
31932 0 : for (j = 0; j < nargs; j++) newargs[j] = args[j];
31933 0 : kwnames = PyTuple_New(nkw);
31934 0 : if (unlikely(kwnames == NULL)) {
31935 0 : PyMem_Free(newargs);
31936 0 : return NULL;
31937 : }
31938 0 : kwvalues = newargs + nargs;
31939 0 : pos = i = 0;
31940 0 : keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
31941 0 : while (PyDict_Next(kw, &pos, &key, &value)) {
31942 0 : keys_are_strings &= Py_TYPE(key)->tp_flags;
31943 0 : Py_INCREF(key);
31944 0 : Py_INCREF(value);
31945 0 : PyTuple_SET_ITEM(kwnames, i, key);
31946 0 : kwvalues[i] = value;
31947 0 : i++;
31948 : }
31949 0 : if (unlikely(!keys_are_strings)) {
31950 0 : PyErr_SetString(PyExc_TypeError, "keywords must be strings");
31951 0 : goto cleanup;
31952 : }
31953 0 : res = vc(func, newargs, nargs, kwnames);
31954 0 : cleanup:
31955 0 : Py_DECREF(kwnames);
31956 0 : for (i = 0; i < nkw; i++)
31957 0 : Py_DECREF(kwvalues[i]);
31958 0 : PyMem_Free(newargs);
31959 0 : return res;
31960 : }
31961 0 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
31962 : {
31963 0 : if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
31964 0 : return vc(func, args, nargs, NULL);
31965 : }
31966 0 : return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
31967 : }
31968 : #endif
31969 :
31970 : /* CythonFunctionShared */
31971 : #if CYTHON_COMPILING_IN_LIMITED_API
31972 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
31973 : if (__Pyx_CyFunction_Check(func)) {
31974 : return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
31975 : } else if (PyCFunction_Check(func)) {
31976 : return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
31977 : }
31978 : return 0;
31979 : }
31980 : #else
31981 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
31982 : return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
31983 : }
31984 : #endif
31985 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
31986 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
31987 : __Pyx_Py_XDECREF_SET(
31988 : __Pyx_CyFunction_GetClassObj(f),
31989 : ((classobj) ? __Pyx_NewRef(classobj) : NULL));
31990 : #else
31991 : __Pyx_Py_XDECREF_SET(
31992 : ((PyCMethodObject *) (f))->mm_class,
31993 : (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
31994 : #endif
31995 : }
31996 : static PyObject *
31997 0 : __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
31998 : {
31999 0 : CYTHON_UNUSED_VAR(closure);
32000 0 : if (unlikely(op->func_doc == NULL)) {
32001 : #if CYTHON_COMPILING_IN_LIMITED_API
32002 : op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
32003 : if (unlikely(!op->func_doc)) return NULL;
32004 : #else
32005 0 : if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
32006 : #if PY_MAJOR_VERSION >= 3
32007 0 : op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
32008 : #else
32009 : op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
32010 : #endif
32011 0 : if (unlikely(op->func_doc == NULL))
32012 : return NULL;
32013 : } else {
32014 0 : Py_INCREF(Py_None);
32015 0 : return Py_None;
32016 : }
32017 : #endif
32018 : }
32019 0 : Py_INCREF(op->func_doc);
32020 : return op->func_doc;
32021 : }
32022 : static int
32023 0 : __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
32024 : {
32025 0 : CYTHON_UNUSED_VAR(context);
32026 0 : if (value == NULL) {
32027 0 : value = Py_None;
32028 : }
32029 0 : Py_INCREF(value);
32030 0 : __Pyx_Py_XDECREF_SET(op->func_doc, value);
32031 0 : return 0;
32032 : }
32033 : static PyObject *
32034 0 : __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
32035 : {
32036 0 : CYTHON_UNUSED_VAR(context);
32037 0 : if (unlikely(op->func_name == NULL)) {
32038 : #if CYTHON_COMPILING_IN_LIMITED_API
32039 : op->func_name = PyObject_GetAttrString(op->func, "__name__");
32040 : #elif PY_MAJOR_VERSION >= 3
32041 0 : op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
32042 : #else
32043 : op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
32044 : #endif
32045 0 : if (unlikely(op->func_name == NULL))
32046 : return NULL;
32047 : }
32048 0 : Py_INCREF(op->func_name);
32049 : return op->func_name;
32050 : }
32051 : static int
32052 0 : __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
32053 : {
32054 0 : CYTHON_UNUSED_VAR(context);
32055 : #if PY_MAJOR_VERSION >= 3
32056 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
32057 : #else
32058 : if (unlikely(value == NULL || !PyString_Check(value)))
32059 : #endif
32060 : {
32061 0 : PyErr_SetString(PyExc_TypeError,
32062 : "__name__ must be set to a string object");
32063 0 : return -1;
32064 : }
32065 0 : Py_INCREF(value);
32066 0 : __Pyx_Py_XDECREF_SET(op->func_name, value);
32067 0 : return 0;
32068 : }
32069 : static PyObject *
32070 0 : __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
32071 : {
32072 0 : CYTHON_UNUSED_VAR(context);
32073 0 : Py_INCREF(op->func_qualname);
32074 0 : return op->func_qualname;
32075 : }
32076 : static int
32077 0 : __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
32078 : {
32079 0 : CYTHON_UNUSED_VAR(context);
32080 : #if PY_MAJOR_VERSION >= 3
32081 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
32082 : #else
32083 : if (unlikely(value == NULL || !PyString_Check(value)))
32084 : #endif
32085 : {
32086 0 : PyErr_SetString(PyExc_TypeError,
32087 : "__qualname__ must be set to a string object");
32088 0 : return -1;
32089 : }
32090 0 : Py_INCREF(value);
32091 0 : __Pyx_Py_XDECREF_SET(op->func_qualname, value);
32092 0 : return 0;
32093 : }
32094 : static PyObject *
32095 0 : __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
32096 : {
32097 0 : CYTHON_UNUSED_VAR(context);
32098 0 : if (unlikely(op->func_dict == NULL)) {
32099 0 : op->func_dict = PyDict_New();
32100 0 : if (unlikely(op->func_dict == NULL))
32101 : return NULL;
32102 : }
32103 0 : Py_INCREF(op->func_dict);
32104 : return op->func_dict;
32105 : }
32106 : static int
32107 0 : __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
32108 : {
32109 0 : CYTHON_UNUSED_VAR(context);
32110 0 : if (unlikely(value == NULL)) {
32111 0 : PyErr_SetString(PyExc_TypeError,
32112 : "function's dictionary may not be deleted");
32113 0 : return -1;
32114 : }
32115 0 : if (unlikely(!PyDict_Check(value))) {
32116 0 : PyErr_SetString(PyExc_TypeError,
32117 : "setting function's dictionary to a non-dict");
32118 0 : return -1;
32119 : }
32120 0 : Py_INCREF(value);
32121 0 : __Pyx_Py_XDECREF_SET(op->func_dict, value);
32122 0 : return 0;
32123 : }
32124 : static PyObject *
32125 0 : __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
32126 : {
32127 0 : CYTHON_UNUSED_VAR(context);
32128 0 : Py_INCREF(op->func_globals);
32129 0 : return op->func_globals;
32130 : }
32131 : static PyObject *
32132 0 : __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
32133 : {
32134 0 : CYTHON_UNUSED_VAR(op);
32135 0 : CYTHON_UNUSED_VAR(context);
32136 0 : Py_INCREF(Py_None);
32137 0 : return Py_None;
32138 : }
32139 : static PyObject *
32140 0 : __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
32141 : {
32142 0 : PyObject* result = (op->func_code) ? op->func_code : Py_None;
32143 0 : CYTHON_UNUSED_VAR(context);
32144 0 : Py_INCREF(result);
32145 0 : return result;
32146 : }
32147 : static int
32148 0 : __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
32149 0 : int result = 0;
32150 0 : PyObject *res = op->defaults_getter((PyObject *) op);
32151 0 : if (unlikely(!res))
32152 : return -1;
32153 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32154 0 : op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
32155 0 : Py_INCREF(op->defaults_tuple);
32156 0 : op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
32157 0 : Py_INCREF(op->defaults_kwdict);
32158 : #else
32159 : op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
32160 : if (unlikely(!op->defaults_tuple)) result = -1;
32161 : else {
32162 : op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
32163 : if (unlikely(!op->defaults_kwdict)) result = -1;
32164 : }
32165 : #endif
32166 0 : Py_DECREF(res);
32167 : return result;
32168 : }
32169 : static int
32170 0 : __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
32171 0 : CYTHON_UNUSED_VAR(context);
32172 0 : if (!value) {
32173 : value = Py_None;
32174 0 : } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
32175 0 : PyErr_SetString(PyExc_TypeError,
32176 : "__defaults__ must be set to a tuple object");
32177 0 : return -1;
32178 : }
32179 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
32180 : "currently affect the values used in function calls", 1);
32181 0 : Py_INCREF(value);
32182 0 : __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
32183 0 : return 0;
32184 : }
32185 : static PyObject *
32186 0 : __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
32187 0 : PyObject* result = op->defaults_tuple;
32188 0 : CYTHON_UNUSED_VAR(context);
32189 0 : if (unlikely(!result)) {
32190 0 : if (op->defaults_getter) {
32191 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
32192 0 : result = op->defaults_tuple;
32193 : } else {
32194 : result = Py_None;
32195 : }
32196 : }
32197 0 : Py_INCREF(result);
32198 : return result;
32199 : }
32200 : static int
32201 0 : __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
32202 0 : CYTHON_UNUSED_VAR(context);
32203 0 : if (!value) {
32204 : value = Py_None;
32205 0 : } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
32206 0 : PyErr_SetString(PyExc_TypeError,
32207 : "__kwdefaults__ must be set to a dict object");
32208 0 : return -1;
32209 : }
32210 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
32211 : "currently affect the values used in function calls", 1);
32212 0 : Py_INCREF(value);
32213 0 : __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
32214 0 : return 0;
32215 : }
32216 : static PyObject *
32217 0 : __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
32218 0 : PyObject* result = op->defaults_kwdict;
32219 0 : CYTHON_UNUSED_VAR(context);
32220 0 : if (unlikely(!result)) {
32221 0 : if (op->defaults_getter) {
32222 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
32223 0 : result = op->defaults_kwdict;
32224 : } else {
32225 : result = Py_None;
32226 : }
32227 : }
32228 0 : Py_INCREF(result);
32229 : return result;
32230 : }
32231 : static int
32232 0 : __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
32233 0 : CYTHON_UNUSED_VAR(context);
32234 0 : if (!value || value == Py_None) {
32235 : value = NULL;
32236 0 : } else if (unlikely(!PyDict_Check(value))) {
32237 0 : PyErr_SetString(PyExc_TypeError,
32238 : "__annotations__ must be set to a dict object");
32239 0 : return -1;
32240 : }
32241 0 : Py_XINCREF(value);
32242 0 : __Pyx_Py_XDECREF_SET(op->func_annotations, value);
32243 0 : return 0;
32244 : }
32245 : static PyObject *
32246 0 : __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
32247 0 : PyObject* result = op->func_annotations;
32248 0 : CYTHON_UNUSED_VAR(context);
32249 0 : if (unlikely(!result)) {
32250 0 : result = PyDict_New();
32251 0 : if (unlikely(!result)) return NULL;
32252 0 : op->func_annotations = result;
32253 : }
32254 0 : Py_INCREF(result);
32255 : return result;
32256 : }
32257 : static PyObject *
32258 0 : __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
32259 0 : int is_coroutine;
32260 0 : CYTHON_UNUSED_VAR(context);
32261 0 : if (op->func_is_coroutine) {
32262 0 : return __Pyx_NewRef(op->func_is_coroutine);
32263 : }
32264 0 : is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
32265 : #if PY_VERSION_HEX >= 0x03050000
32266 0 : if (is_coroutine) {
32267 0 : PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
32268 0 : fromlist = PyList_New(1);
32269 0 : if (unlikely(!fromlist)) return NULL;
32270 0 : Py_INCREF(marker);
32271 : #if CYTHON_ASSUME_SAFE_MACROS
32272 0 : PyList_SET_ITEM(fromlist, 0, marker);
32273 : #else
32274 : if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
32275 : Py_DECREF(marker);
32276 : Py_DECREF(fromlist);
32277 : return NULL;
32278 : }
32279 : #endif
32280 0 : module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
32281 0 : Py_DECREF(fromlist);
32282 0 : if (unlikely(!module)) goto ignore;
32283 0 : op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
32284 0 : Py_DECREF(module);
32285 0 : if (likely(op->func_is_coroutine)) {
32286 0 : return __Pyx_NewRef(op->func_is_coroutine);
32287 : }
32288 0 : ignore:
32289 0 : PyErr_Clear();
32290 : }
32291 : #endif
32292 0 : op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
32293 0 : return __Pyx_NewRef(op->func_is_coroutine);
32294 : }
32295 : #if CYTHON_COMPILING_IN_LIMITED_API
32296 : static PyObject *
32297 : __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
32298 : CYTHON_UNUSED_VAR(context);
32299 : return PyObject_GetAttrString(op->func, "__module__");
32300 : }
32301 : static int
32302 : __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
32303 : CYTHON_UNUSED_VAR(context);
32304 : return PyObject_SetAttrString(op->func, "__module__", value);
32305 : }
32306 : #endif
32307 : static PyGetSetDef __pyx_CyFunction_getsets[] = {
32308 : {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
32309 : {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
32310 : {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
32311 : {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
32312 : {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
32313 : {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
32314 : {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
32315 : {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
32316 : {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
32317 : {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
32318 : {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
32319 : {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
32320 : {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
32321 : {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
32322 : {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
32323 : {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
32324 : {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
32325 : {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
32326 : #if CYTHON_COMPILING_IN_LIMITED_API
32327 : {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
32328 : #endif
32329 : {0, 0, 0, 0, 0}
32330 : };
32331 : static PyMemberDef __pyx_CyFunction_members[] = {
32332 : #if !CYTHON_COMPILING_IN_LIMITED_API
32333 : {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
32334 : #endif
32335 : #if CYTHON_USE_TYPE_SPECS
32336 : {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
32337 : #if CYTHON_METH_FASTCALL
32338 : #if CYTHON_BACKPORT_VECTORCALL
32339 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
32340 : #else
32341 : #if !CYTHON_COMPILING_IN_LIMITED_API
32342 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
32343 : #endif
32344 : #endif
32345 : #endif
32346 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
32347 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
32348 : #else
32349 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
32350 : #endif
32351 : #endif
32352 : {0, 0, 0, 0, 0}
32353 : };
32354 : static PyObject *
32355 0 : __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
32356 : {
32357 0 : CYTHON_UNUSED_VAR(args);
32358 : #if PY_MAJOR_VERSION >= 3
32359 0 : Py_INCREF(m->func_qualname);
32360 0 : return m->func_qualname;
32361 : #else
32362 : return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
32363 : #endif
32364 : }
32365 : static PyMethodDef __pyx_CyFunction_methods[] = {
32366 : {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
32367 : {0, 0, 0, 0}
32368 : };
32369 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
32370 : #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
32371 : #else
32372 : #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
32373 : #endif
32374 2 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
32375 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
32376 : #if !CYTHON_COMPILING_IN_LIMITED_API
32377 2 : PyCFunctionObject *cf = (PyCFunctionObject*) op;
32378 : #endif
32379 2 : if (unlikely(op == NULL))
32380 : return NULL;
32381 : #if CYTHON_COMPILING_IN_LIMITED_API
32382 : op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
32383 : if (unlikely(!op->func)) return NULL;
32384 : #endif
32385 2 : op->flags = flags;
32386 2 : __Pyx_CyFunction_weakreflist(op) = NULL;
32387 : #if !CYTHON_COMPILING_IN_LIMITED_API
32388 2 : cf->m_ml = ml;
32389 2 : cf->m_self = (PyObject *) op;
32390 : #endif
32391 2 : Py_XINCREF(closure);
32392 2 : op->func_closure = closure;
32393 : #if !CYTHON_COMPILING_IN_LIMITED_API
32394 2 : Py_XINCREF(module);
32395 2 : cf->m_module = module;
32396 : #endif
32397 2 : op->func_dict = NULL;
32398 2 : op->func_name = NULL;
32399 2 : Py_INCREF(qualname);
32400 2 : op->func_qualname = qualname;
32401 2 : op->func_doc = NULL;
32402 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
32403 : op->func_classobj = NULL;
32404 : #else
32405 2 : ((PyCMethodObject*)op)->mm_class = NULL;
32406 : #endif
32407 2 : op->func_globals = globals;
32408 2 : Py_INCREF(op->func_globals);
32409 2 : Py_XINCREF(code);
32410 2 : op->func_code = code;
32411 2 : op->defaults_pyobjects = 0;
32412 2 : op->defaults_size = 0;
32413 2 : op->defaults = NULL;
32414 2 : op->defaults_tuple = NULL;
32415 2 : op->defaults_kwdict = NULL;
32416 2 : op->defaults_getter = NULL;
32417 2 : op->func_annotations = NULL;
32418 2 : op->func_is_coroutine = NULL;
32419 : #if CYTHON_METH_FASTCALL
32420 2 : switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
32421 0 : case METH_NOARGS:
32422 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
32423 0 : break;
32424 0 : case METH_O:
32425 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
32426 0 : break;
32427 0 : case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
32428 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
32429 0 : break;
32430 2 : case METH_FASTCALL | METH_KEYWORDS:
32431 2 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
32432 2 : break;
32433 0 : case METH_VARARGS | METH_KEYWORDS:
32434 0 : __Pyx_CyFunction_func_vectorcall(op) = NULL;
32435 0 : break;
32436 0 : default:
32437 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
32438 0 : Py_DECREF(op);
32439 : return NULL;
32440 : }
32441 : #endif
32442 : return (PyObject *) op;
32443 : }
32444 : static int
32445 0 : __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
32446 : {
32447 0 : Py_CLEAR(m->func_closure);
32448 : #if CYTHON_COMPILING_IN_LIMITED_API
32449 : Py_CLEAR(m->func);
32450 : #else
32451 0 : Py_CLEAR(((PyCFunctionObject*)m)->m_module);
32452 : #endif
32453 0 : Py_CLEAR(m->func_dict);
32454 0 : Py_CLEAR(m->func_name);
32455 0 : Py_CLEAR(m->func_qualname);
32456 0 : Py_CLEAR(m->func_doc);
32457 0 : Py_CLEAR(m->func_globals);
32458 0 : Py_CLEAR(m->func_code);
32459 : #if !CYTHON_COMPILING_IN_LIMITED_API
32460 : #if PY_VERSION_HEX < 0x030900B1
32461 : Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
32462 : #else
32463 : {
32464 0 : PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
32465 0 : ((PyCMethodObject *) (m))->mm_class = NULL;
32466 0 : Py_XDECREF(cls);
32467 : }
32468 : #endif
32469 : #endif
32470 0 : Py_CLEAR(m->defaults_tuple);
32471 0 : Py_CLEAR(m->defaults_kwdict);
32472 0 : Py_CLEAR(m->func_annotations);
32473 0 : Py_CLEAR(m->func_is_coroutine);
32474 0 : if (m->defaults) {
32475 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
32476 : int i;
32477 0 : for (i = 0; i < m->defaults_pyobjects; i++)
32478 0 : Py_XDECREF(pydefaults[i]);
32479 0 : PyObject_Free(m->defaults);
32480 0 : m->defaults = NULL;
32481 : }
32482 0 : return 0;
32483 : }
32484 0 : static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
32485 : {
32486 0 : if (__Pyx_CyFunction_weakreflist(m) != NULL)
32487 0 : PyObject_ClearWeakRefs((PyObject *) m);
32488 0 : __Pyx_CyFunction_clear(m);
32489 0 : __Pyx_PyHeapTypeObject_GC_Del(m);
32490 0 : }
32491 0 : static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
32492 : {
32493 0 : PyObject_GC_UnTrack(m);
32494 0 : __Pyx__CyFunction_dealloc(m);
32495 0 : }
32496 0 : static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
32497 : {
32498 0 : Py_VISIT(m->func_closure);
32499 : #if CYTHON_COMPILING_IN_LIMITED_API
32500 : Py_VISIT(m->func);
32501 : #else
32502 0 : Py_VISIT(((PyCFunctionObject*)m)->m_module);
32503 : #endif
32504 0 : Py_VISIT(m->func_dict);
32505 0 : Py_VISIT(m->func_name);
32506 0 : Py_VISIT(m->func_qualname);
32507 0 : Py_VISIT(m->func_doc);
32508 0 : Py_VISIT(m->func_globals);
32509 0 : Py_VISIT(m->func_code);
32510 : #if !CYTHON_COMPILING_IN_LIMITED_API
32511 0 : Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
32512 : #endif
32513 0 : Py_VISIT(m->defaults_tuple);
32514 0 : Py_VISIT(m->defaults_kwdict);
32515 0 : Py_VISIT(m->func_is_coroutine);
32516 0 : if (m->defaults) {
32517 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
32518 : int i;
32519 0 : for (i = 0; i < m->defaults_pyobjects; i++)
32520 0 : Py_VISIT(pydefaults[i]);
32521 : }
32522 : return 0;
32523 : }
32524 : static PyObject*
32525 0 : __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
32526 : {
32527 : #if PY_MAJOR_VERSION >= 3
32528 0 : return PyUnicode_FromFormat("<cyfunction %U at %p>",
32529 : op->func_qualname, (void *)op);
32530 : #else
32531 : return PyString_FromFormat("<cyfunction %s at %p>",
32532 : PyString_AsString(op->func_qualname), (void *)op);
32533 : #endif
32534 : }
32535 0 : static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
32536 : #if CYTHON_COMPILING_IN_LIMITED_API
32537 : PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
32538 : PyObject *py_name = NULL;
32539 : PyCFunction meth;
32540 : int flags;
32541 : meth = PyCFunction_GetFunction(f);
32542 : if (unlikely(!meth)) return NULL;
32543 : flags = PyCFunction_GetFlags(f);
32544 : if (unlikely(flags < 0)) return NULL;
32545 : #else
32546 0 : PyCFunctionObject* f = (PyCFunctionObject*)func;
32547 0 : PyCFunction meth = f->m_ml->ml_meth;
32548 0 : int flags = f->m_ml->ml_flags;
32549 : #endif
32550 0 : Py_ssize_t size;
32551 0 : switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
32552 0 : case METH_VARARGS:
32553 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0))
32554 0 : return (*meth)(self, arg);
32555 : break;
32556 0 : case METH_VARARGS | METH_KEYWORDS:
32557 0 : return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
32558 0 : case METH_NOARGS:
32559 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
32560 : #if CYTHON_ASSUME_SAFE_MACROS
32561 0 : size = PyTuple_GET_SIZE(arg);
32562 : #else
32563 : size = PyTuple_Size(arg);
32564 : if (unlikely(size < 0)) return NULL;
32565 : #endif
32566 0 : if (likely(size == 0))
32567 0 : return (*meth)(self, NULL);
32568 : #if CYTHON_COMPILING_IN_LIMITED_API
32569 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
32570 : if (!py_name) return NULL;
32571 : PyErr_Format(PyExc_TypeError,
32572 : "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
32573 : py_name, size);
32574 : Py_DECREF(py_name);
32575 : #else
32576 0 : PyErr_Format(PyExc_TypeError,
32577 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
32578 0 : f->m_ml->ml_name, size);
32579 : #endif
32580 0 : return NULL;
32581 : }
32582 : break;
32583 0 : case METH_O:
32584 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
32585 : #if CYTHON_ASSUME_SAFE_MACROS
32586 0 : size = PyTuple_GET_SIZE(arg);
32587 : #else
32588 : size = PyTuple_Size(arg);
32589 : if (unlikely(size < 0)) return NULL;
32590 : #endif
32591 0 : if (likely(size == 1)) {
32592 0 : PyObject *result, *arg0;
32593 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32594 0 : arg0 = PyTuple_GET_ITEM(arg, 0);
32595 : #else
32596 : arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
32597 : #endif
32598 0 : result = (*meth)(self, arg0);
32599 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
32600 : Py_DECREF(arg0);
32601 : #endif
32602 0 : return result;
32603 : }
32604 : #if CYTHON_COMPILING_IN_LIMITED_API
32605 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
32606 : if (!py_name) return NULL;
32607 : PyErr_Format(PyExc_TypeError,
32608 : "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
32609 : py_name, size);
32610 : Py_DECREF(py_name);
32611 : #else
32612 0 : PyErr_Format(PyExc_TypeError,
32613 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
32614 0 : f->m_ml->ml_name, size);
32615 : #endif
32616 0 : return NULL;
32617 : }
32618 : break;
32619 0 : default:
32620 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
32621 0 : return NULL;
32622 : }
32623 : #if CYTHON_COMPILING_IN_LIMITED_API
32624 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
32625 : if (!py_name) return NULL;
32626 : PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
32627 : py_name);
32628 : Py_DECREF(py_name);
32629 : #else
32630 0 : PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
32631 0 : f->m_ml->ml_name);
32632 : #endif
32633 0 : return NULL;
32634 : }
32635 0 : static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
32636 0 : PyObject *self, *result;
32637 : #if CYTHON_COMPILING_IN_LIMITED_API
32638 : self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
32639 : if (unlikely(!self) && PyErr_Occurred()) return NULL;
32640 : #else
32641 0 : self = ((PyCFunctionObject*)func)->m_self;
32642 : #endif
32643 0 : result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
32644 0 : return result;
32645 : }
32646 0 : static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
32647 0 : PyObject *result;
32648 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
32649 : #if CYTHON_METH_FASTCALL
32650 0 : __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
32651 0 : if (vc) {
32652 : #if CYTHON_ASSUME_SAFE_MACROS
32653 0 : return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
32654 : #else
32655 : (void) &__Pyx_PyVectorcall_FastCallDict;
32656 : return PyVectorcall_Call(func, args, kw);
32657 : #endif
32658 : }
32659 : #endif
32660 0 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
32661 0 : Py_ssize_t argc;
32662 0 : PyObject *new_args;
32663 0 : PyObject *self;
32664 : #if CYTHON_ASSUME_SAFE_MACROS
32665 0 : argc = PyTuple_GET_SIZE(args);
32666 : #else
32667 : argc = PyTuple_Size(args);
32668 : if (unlikely(!argc) < 0) return NULL;
32669 : #endif
32670 0 : new_args = PyTuple_GetSlice(args, 1, argc);
32671 0 : if (unlikely(!new_args))
32672 : return NULL;
32673 0 : self = PyTuple_GetItem(args, 0);
32674 0 : if (unlikely(!self)) {
32675 0 : Py_DECREF(new_args);
32676 : #if PY_MAJOR_VERSION > 2
32677 0 : PyErr_Format(PyExc_TypeError,
32678 : "unbound method %.200S() needs an argument",
32679 : cyfunc->func_qualname);
32680 : #else
32681 : PyErr_SetString(PyExc_TypeError,
32682 : "unbound method needs an argument");
32683 : #endif
32684 0 : return NULL;
32685 : }
32686 0 : result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
32687 0 : Py_DECREF(new_args);
32688 : } else {
32689 0 : result = __Pyx_CyFunction_Call(func, args, kw);
32690 : }
32691 : return result;
32692 : }
32693 : #if CYTHON_METH_FASTCALL
32694 136 : static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
32695 : {
32696 136 : int ret = 0;
32697 136 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
32698 0 : if (unlikely(nargs < 1)) {
32699 0 : PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
32700 0 : ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
32701 0 : return -1;
32702 : }
32703 : ret = 1;
32704 : }
32705 136 : if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
32706 0 : PyErr_Format(PyExc_TypeError,
32707 0 : "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
32708 0 : return -1;
32709 : }
32710 : return ret;
32711 : }
32712 0 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32713 : {
32714 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
32715 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
32716 : #if CYTHON_BACKPORT_VECTORCALL
32717 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
32718 : #else
32719 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32720 : #endif
32721 0 : PyObject *self;
32722 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
32723 0 : case 1:
32724 0 : self = args[0];
32725 0 : args += 1;
32726 0 : nargs -= 1;
32727 0 : break;
32728 0 : case 0:
32729 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
32730 0 : break;
32731 : default:
32732 : return NULL;
32733 : }
32734 0 : if (unlikely(nargs != 0)) {
32735 0 : PyErr_Format(PyExc_TypeError,
32736 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
32737 : def->ml_name, nargs);
32738 0 : return NULL;
32739 : }
32740 0 : return def->ml_meth(self, NULL);
32741 : }
32742 0 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32743 : {
32744 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
32745 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
32746 : #if CYTHON_BACKPORT_VECTORCALL
32747 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
32748 : #else
32749 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32750 : #endif
32751 0 : PyObject *self;
32752 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
32753 0 : case 1:
32754 0 : self = args[0];
32755 0 : args += 1;
32756 0 : nargs -= 1;
32757 0 : break;
32758 0 : case 0:
32759 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
32760 0 : break;
32761 : default:
32762 : return NULL;
32763 : }
32764 0 : if (unlikely(nargs != 1)) {
32765 0 : PyErr_Format(PyExc_TypeError,
32766 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
32767 : def->ml_name, nargs);
32768 0 : return NULL;
32769 : }
32770 0 : return def->ml_meth(self, args[0]);
32771 : }
32772 136 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32773 : {
32774 136 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
32775 136 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
32776 : #if CYTHON_BACKPORT_VECTORCALL
32777 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
32778 : #else
32779 136 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32780 : #endif
32781 136 : PyObject *self;
32782 136 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
32783 0 : case 1:
32784 0 : self = args[0];
32785 0 : args += 1;
32786 0 : nargs -= 1;
32787 0 : break;
32788 136 : case 0:
32789 136 : self = ((PyCFunctionObject*)cyfunc)->m_self;
32790 136 : break;
32791 : default:
32792 : return NULL;
32793 : }
32794 136 : return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
32795 : }
32796 0 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32797 : {
32798 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
32799 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
32800 0 : PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
32801 : #if CYTHON_BACKPORT_VECTORCALL
32802 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
32803 : #else
32804 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32805 : #endif
32806 0 : PyObject *self;
32807 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
32808 0 : case 1:
32809 0 : self = args[0];
32810 0 : args += 1;
32811 0 : nargs -= 1;
32812 0 : break;
32813 0 : case 0:
32814 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
32815 0 : break;
32816 : default:
32817 : return NULL;
32818 : }
32819 0 : return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
32820 : }
32821 : #endif
32822 : #if CYTHON_USE_TYPE_SPECS
32823 : static PyType_Slot __pyx_CyFunctionType_slots[] = {
32824 : {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
32825 : {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
32826 : {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
32827 : {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
32828 : {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
32829 : {Py_tp_methods, (void *)__pyx_CyFunction_methods},
32830 : {Py_tp_members, (void *)__pyx_CyFunction_members},
32831 : {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
32832 : {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
32833 : {0, 0},
32834 : };
32835 : static PyType_Spec __pyx_CyFunctionType_spec = {
32836 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
32837 : sizeof(__pyx_CyFunctionObject),
32838 : 0,
32839 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
32840 : Py_TPFLAGS_METHOD_DESCRIPTOR |
32841 : #endif
32842 : #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
32843 : _Py_TPFLAGS_HAVE_VECTORCALL |
32844 : #endif
32845 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
32846 : __pyx_CyFunctionType_slots
32847 : };
32848 : #else
32849 : static PyTypeObject __pyx_CyFunctionType_type = {
32850 : PyVarObject_HEAD_INIT(0, 0)
32851 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
32852 : sizeof(__pyx_CyFunctionObject),
32853 : 0,
32854 : (destructor) __Pyx_CyFunction_dealloc,
32855 : #if !CYTHON_METH_FASTCALL
32856 : 0,
32857 : #elif CYTHON_BACKPORT_VECTORCALL
32858 : (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
32859 : #else
32860 : offsetof(PyCFunctionObject, vectorcall),
32861 : #endif
32862 : 0,
32863 : 0,
32864 : #if PY_MAJOR_VERSION < 3
32865 : 0,
32866 : #else
32867 : 0,
32868 : #endif
32869 : (reprfunc) __Pyx_CyFunction_repr,
32870 : 0,
32871 : 0,
32872 : 0,
32873 : 0,
32874 : __Pyx_CyFunction_CallAsMethod,
32875 : 0,
32876 : 0,
32877 : 0,
32878 : 0,
32879 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
32880 : Py_TPFLAGS_METHOD_DESCRIPTOR |
32881 : #endif
32882 : #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
32883 : _Py_TPFLAGS_HAVE_VECTORCALL |
32884 : #endif
32885 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
32886 : 0,
32887 : (traverseproc) __Pyx_CyFunction_traverse,
32888 : (inquiry) __Pyx_CyFunction_clear,
32889 : 0,
32890 : #if PY_VERSION_HEX < 0x030500A0
32891 : offsetof(__pyx_CyFunctionObject, func_weakreflist),
32892 : #else
32893 : offsetof(PyCFunctionObject, m_weakreflist),
32894 : #endif
32895 : 0,
32896 : 0,
32897 : __pyx_CyFunction_methods,
32898 : __pyx_CyFunction_members,
32899 : __pyx_CyFunction_getsets,
32900 : 0,
32901 : 0,
32902 : __Pyx_PyMethod_New,
32903 : 0,
32904 : offsetof(__pyx_CyFunctionObject, func_dict),
32905 : 0,
32906 : 0,
32907 : 0,
32908 : 0,
32909 : 0,
32910 : 0,
32911 : 0,
32912 : 0,
32913 : 0,
32914 : 0,
32915 : 0,
32916 : 0,
32917 : #if PY_VERSION_HEX >= 0x030400a1
32918 : 0,
32919 : #endif
32920 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
32921 : 0,
32922 : #endif
32923 : #if __PYX_NEED_TP_PRINT_SLOT
32924 : 0,
32925 : #endif
32926 : #if PY_VERSION_HEX >= 0x030C0000
32927 : 0,
32928 : #endif
32929 : #if PY_VERSION_HEX >= 0x030d00A4
32930 : 0,
32931 : #endif
32932 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
32933 : 0,
32934 : #endif
32935 : };
32936 : #endif
32937 1 : static int __pyx_CyFunction_init(PyObject *module) {
32938 : #if CYTHON_USE_TYPE_SPECS
32939 : __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
32940 : #else
32941 1 : CYTHON_UNUSED_VAR(module);
32942 1 : __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
32943 : #endif
32944 1 : if (unlikely(__pyx_CyFunctionType == NULL)) {
32945 0 : return -1;
32946 : }
32947 : return 0;
32948 : }
32949 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
32950 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
32951 : m->defaults = PyObject_Malloc(size);
32952 : if (unlikely(!m->defaults))
32953 : return PyErr_NoMemory();
32954 : memset(m->defaults, 0, size);
32955 : m->defaults_pyobjects = pyobjects;
32956 : m->defaults_size = size;
32957 : return m->defaults;
32958 : }
32959 2 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
32960 2 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
32961 2 : m->defaults_tuple = tuple;
32962 4 : Py_INCREF(tuple);
32963 : }
32964 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
32965 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
32966 : m->defaults_kwdict = dict;
32967 : Py_INCREF(dict);
32968 : }
32969 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
32970 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
32971 : m->func_annotations = dict;
32972 : Py_INCREF(dict);
32973 : }
32974 :
32975 : /* CythonFunction */
32976 2 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
32977 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
32978 2 : PyObject *op = __Pyx_CyFunction_Init(
32979 2 : PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
32980 : ml, flags, qualname, closure, module, globals, code
32981 : );
32982 2 : if (likely(op)) {
32983 2 : PyObject_GC_Track(op);
32984 : }
32985 2 : return op;
32986 : }
32987 :
32988 : /* CLineInTraceback */
32989 : #ifndef CYTHON_CLINE_IN_TRACEBACK
32990 44 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
32991 44 : PyObject *use_cline;
32992 44 : PyObject *ptype, *pvalue, *ptraceback;
32993 : #if CYTHON_COMPILING_IN_CPYTHON
32994 44 : PyObject **cython_runtime_dict;
32995 : #endif
32996 44 : CYTHON_MAYBE_UNUSED_VAR(tstate);
32997 44 : if (unlikely(!__pyx_cython_runtime)) {
32998 : return c_line;
32999 : }
33000 44 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
33001 : #if CYTHON_COMPILING_IN_CPYTHON
33002 44 : cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
33003 44 : if (likely(cython_runtime_dict)) {
33004 44 : __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
33005 : use_cline, *cython_runtime_dict,
33006 : __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
33007 : } else
33008 : #endif
33009 : {
33010 0 : PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
33011 0 : if (use_cline_obj) {
33012 0 : use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
33013 0 : Py_DECREF(use_cline_obj);
33014 : } else {
33015 0 : PyErr_Clear();
33016 0 : use_cline = NULL;
33017 : }
33018 : }
33019 44 : if (!use_cline) {
33020 0 : c_line = 0;
33021 0 : (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
33022 : }
33023 44 : else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
33024 : c_line = 0;
33025 : }
33026 44 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
33027 44 : return c_line;
33028 : }
33029 : #endif
33030 :
33031 : /* CodeObjectCache */
33032 : #if !CYTHON_COMPILING_IN_LIMITED_API
33033 45 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
33034 45 : int start = 0, mid = 0, end = count - 1;
33035 45 : if (end >= 0 && code_line > entries[end].code_line) {
33036 : return count;
33037 : }
33038 53 : while (start < end) {
33039 8 : mid = start + (end - start) / 2;
33040 8 : if (code_line < entries[mid].code_line) {
33041 : end = mid;
33042 8 : } else if (code_line > entries[mid].code_line) {
33043 8 : start = mid + 1;
33044 : } else {
33045 0 : return mid;
33046 : }
33047 : }
33048 45 : if (code_line <= entries[mid].code_line) {
33049 : return mid;
33050 : } else {
33051 8 : return mid + 1;
33052 : }
33053 : }
33054 44 : static PyCodeObject *__pyx_find_code_object(int code_line) {
33055 44 : PyCodeObject* code_object;
33056 44 : int pos;
33057 44 : if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
33058 : return NULL;
33059 : }
33060 43 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
33061 43 : if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
33062 : return NULL;
33063 : }
33064 41 : code_object = __pyx_code_cache.entries[pos].code_object;
33065 41 : Py_INCREF(code_object);
33066 : return code_object;
33067 : }
33068 3 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
33069 3 : int pos, i;
33070 3 : __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
33071 3 : if (unlikely(!code_line)) {
33072 : return;
33073 : }
33074 3 : if (unlikely(!entries)) {
33075 1 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
33076 1 : if (likely(entries)) {
33077 1 : __pyx_code_cache.entries = entries;
33078 1 : __pyx_code_cache.max_count = 64;
33079 1 : __pyx_code_cache.count = 1;
33080 1 : entries[0].code_line = code_line;
33081 1 : entries[0].code_object = code_object;
33082 1 : Py_INCREF(code_object);
33083 : }
33084 1 : return;
33085 : }
33086 2 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
33087 2 : if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
33088 0 : PyCodeObject* tmp = entries[pos].code_object;
33089 0 : entries[pos].code_object = code_object;
33090 0 : Py_DECREF(tmp);
33091 0 : return;
33092 : }
33093 2 : if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
33094 0 : int new_max = __pyx_code_cache.max_count + 64;
33095 0 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
33096 0 : __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
33097 0 : if (unlikely(!entries)) {
33098 : return;
33099 : }
33100 0 : __pyx_code_cache.entries = entries;
33101 0 : __pyx_code_cache.max_count = new_max;
33102 : }
33103 4 : for (i=__pyx_code_cache.count; i>pos; i--) {
33104 2 : entries[i] = entries[i-1];
33105 : }
33106 2 : entries[pos].code_line = code_line;
33107 2 : entries[pos].code_object = code_object;
33108 2 : __pyx_code_cache.count++;
33109 2 : Py_INCREF(code_object);
33110 : }
33111 : #endif
33112 :
33113 : /* AddTraceback */
33114 : #include "compile.h"
33115 : #include "frameobject.h"
33116 : #include "traceback.h"
33117 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
33118 : #ifndef Py_BUILD_CORE
33119 : #define Py_BUILD_CORE 1
33120 : #endif
33121 : #include "internal/pycore_frame.h"
33122 : #endif
33123 : #if CYTHON_COMPILING_IN_LIMITED_API
33124 : static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
33125 : PyObject *firstlineno, PyObject *name) {
33126 : PyObject *replace = NULL;
33127 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
33128 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
33129 : replace = PyObject_GetAttrString(code, "replace");
33130 : if (likely(replace)) {
33131 : PyObject *result;
33132 : result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
33133 : Py_DECREF(replace);
33134 : return result;
33135 : }
33136 : PyErr_Clear();
33137 : #if __PYX_LIMITED_VERSION_HEX < 0x030780000
33138 : {
33139 : PyObject *compiled = NULL, *result = NULL;
33140 : if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
33141 : if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
33142 : compiled = Py_CompileString(
33143 : "out = type(code)(\n"
33144 : " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
33145 : " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
33146 : " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
33147 : " code.co_lnotab)\n", "<dummy>", Py_file_input);
33148 : if (!compiled) return NULL;
33149 : result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
33150 : Py_DECREF(compiled);
33151 : if (!result) PyErr_Print();
33152 : Py_DECREF(result);
33153 : result = PyDict_GetItemString(scratch_dict, "out");
33154 : if (result) Py_INCREF(result);
33155 : return result;
33156 : }
33157 : #else
33158 : return NULL;
33159 : #endif
33160 : }
33161 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
33162 : int py_line, const char *filename) {
33163 : PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
33164 : PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
33165 : PyObject *exc_type, *exc_value, *exc_traceback;
33166 : int success = 0;
33167 : if (c_line) {
33168 : (void) __pyx_cfilenm;
33169 : (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
33170 : }
33171 : PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
33172 : code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
33173 : if (unlikely(!code_object)) goto bad;
33174 : py_py_line = PyLong_FromLong(py_line);
33175 : if (unlikely(!py_py_line)) goto bad;
33176 : py_funcname = PyUnicode_FromString(funcname);
33177 : if (unlikely(!py_funcname)) goto bad;
33178 : dict = PyDict_New();
33179 : if (unlikely(!dict)) goto bad;
33180 : {
33181 : PyObject *old_code_object = code_object;
33182 : code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
33183 : Py_DECREF(old_code_object);
33184 : }
33185 : if (unlikely(!code_object)) goto bad;
33186 : getframe = PySys_GetObject("_getframe");
33187 : if (unlikely(!getframe)) goto bad;
33188 : if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
33189 : frame = PyEval_EvalCode(code_object, dict, dict);
33190 : if (unlikely(!frame) || frame == Py_None) goto bad;
33191 : success = 1;
33192 : bad:
33193 : PyErr_Restore(exc_type, exc_value, exc_traceback);
33194 : Py_XDECREF(code_object);
33195 : Py_XDECREF(py_py_line);
33196 : Py_XDECREF(py_funcname);
33197 : Py_XDECREF(dict);
33198 : Py_XDECREF(replace);
33199 : if (success) {
33200 : PyTraceBack_Here(
33201 : (struct _frame*)frame);
33202 : }
33203 : Py_XDECREF(frame);
33204 : }
33205 : #else
33206 3 : static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
33207 : const char *funcname, int c_line,
33208 : int py_line, const char *filename) {
33209 3 : PyCodeObject *py_code = NULL;
33210 3 : PyObject *py_funcname = NULL;
33211 : #if PY_MAJOR_VERSION < 3
33212 : PyObject *py_srcfile = NULL;
33213 : py_srcfile = PyString_FromString(filename);
33214 : if (!py_srcfile) goto bad;
33215 : #endif
33216 3 : if (c_line) {
33217 : #if PY_MAJOR_VERSION < 3
33218 : py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
33219 : if (!py_funcname) goto bad;
33220 : #else
33221 0 : py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
33222 0 : if (!py_funcname) goto bad;
33223 0 : funcname = PyUnicode_AsUTF8(py_funcname);
33224 0 : if (!funcname) goto bad;
33225 : #endif
33226 : }
33227 : else {
33228 : #if PY_MAJOR_VERSION < 3
33229 : py_funcname = PyString_FromString(funcname);
33230 : if (!py_funcname) goto bad;
33231 : #endif
33232 3 : }
33233 : #if PY_MAJOR_VERSION < 3
33234 : py_code = __Pyx_PyCode_New(
33235 : 0,
33236 : 0,
33237 : 0,
33238 : 0,
33239 : 0,
33240 : 0,
33241 : __pyx_empty_bytes, /*PyObject *code,*/
33242 : __pyx_empty_tuple, /*PyObject *consts,*/
33243 : __pyx_empty_tuple, /*PyObject *names,*/
33244 : __pyx_empty_tuple, /*PyObject *varnames,*/
33245 : __pyx_empty_tuple, /*PyObject *freevars,*/
33246 : __pyx_empty_tuple, /*PyObject *cellvars,*/
33247 : py_srcfile, /*PyObject *filename,*/
33248 : py_funcname, /*PyObject *name,*/
33249 : py_line,
33250 : __pyx_empty_bytes /*PyObject *lnotab*/
33251 : );
33252 : Py_DECREF(py_srcfile);
33253 : #else
33254 3 : py_code = PyCode_NewEmpty(filename, funcname, py_line);
33255 : #endif
33256 3 : Py_XDECREF(py_funcname);
33257 3 : return py_code;
33258 0 : bad:
33259 0 : Py_XDECREF(py_funcname);
33260 : #if PY_MAJOR_VERSION < 3
33261 : Py_XDECREF(py_srcfile);
33262 : #endif
33263 0 : return NULL;
33264 : }
33265 44 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
33266 : int py_line, const char *filename) {
33267 44 : PyCodeObject *py_code = 0;
33268 44 : PyFrameObject *py_frame = 0;
33269 44 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
33270 44 : PyObject *ptype, *pvalue, *ptraceback;
33271 44 : if (c_line) {
33272 44 : c_line = __Pyx_CLineForTraceback(tstate, c_line);
33273 : }
33274 88 : py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
33275 44 : if (!py_code) {
33276 3 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
33277 3 : py_code = __Pyx_CreateCodeObjectForTraceback(
33278 : funcname, c_line, py_line, filename);
33279 3 : if (!py_code) {
33280 : /* If the code object creation fails, then we should clear the
33281 : fetched exception references and propagate the new exception */
33282 0 : Py_XDECREF(ptype);
33283 0 : Py_XDECREF(pvalue);
33284 0 : Py_XDECREF(ptraceback);
33285 0 : goto bad;
33286 : }
33287 3 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
33288 3 : __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
33289 : }
33290 88 : py_frame = PyFrame_New(
33291 : tstate, /*PyThreadState *tstate,*/
33292 : py_code, /*PyCodeObject *code,*/
33293 44 : __pyx_d, /*PyObject *globals,*/
33294 : 0 /*PyObject *locals*/
33295 : );
33296 44 : if (!py_frame) goto bad;
33297 44 : __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
33298 44 : PyTraceBack_Here(py_frame);
33299 44 : bad:
33300 44 : Py_XDECREF(py_code);
33301 44 : Py_XDECREF(py_frame);
33302 44 : }
33303 : #endif
33304 :
33305 : #if PY_MAJOR_VERSION < 3
33306 : static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
33307 : __Pyx_TypeName obj_type_name;
33308 : if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
33309 : if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
33310 : if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
33311 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
33312 : PyErr_Format(PyExc_TypeError,
33313 : "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface",
33314 : obj_type_name);
33315 : __Pyx_DECREF_TypeName(obj_type_name);
33316 : return -1;
33317 : }
33318 : static void __Pyx_ReleaseBuffer(Py_buffer *view) {
33319 : PyObject *obj = view->obj;
33320 : if (!obj) return;
33321 : if (PyObject_CheckBuffer(obj)) {
33322 : PyBuffer_Release(view);
33323 : return;
33324 : }
33325 : if ((0)) {}
33326 : view->obj = NULL;
33327 : Py_DECREF(obj);
33328 : }
33329 : #endif
33330 :
33331 :
33332 : /* MemviewSliceIsContig */
33333 : static int
33334 0 : __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
33335 : {
33336 0 : int i, index, step, start;
33337 0 : Py_ssize_t itemsize = mvs.memview->view.itemsize;
33338 0 : if (order == 'F') {
33339 : step = 1;
33340 : start = 0;
33341 : } else {
33342 0 : step = -1;
33343 0 : start = ndim - 1;
33344 : }
33345 0 : for (i = 0; i < ndim; i++) {
33346 0 : index = start + step * i;
33347 0 : if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
33348 : return 0;
33349 0 : itemsize *= mvs.shape[index];
33350 : }
33351 : return 1;
33352 : }
33353 :
33354 : /* OverlappingSlices */
33355 : static void
33356 0 : __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
33357 : void **out_start, void **out_end,
33358 : int ndim, size_t itemsize)
33359 : {
33360 0 : char *start, *end;
33361 0 : int i;
33362 0 : start = end = slice->data;
33363 0 : for (i = 0; i < ndim; i++) {
33364 0 : Py_ssize_t stride = slice->strides[i];
33365 0 : Py_ssize_t extent = slice->shape[i];
33366 0 : if (extent == 0) {
33367 0 : *out_start = *out_end = start;
33368 0 : return;
33369 : } else {
33370 0 : if (stride > 0)
33371 0 : end += stride * (extent - 1);
33372 : else
33373 0 : start += stride * (extent - 1);
33374 : }
33375 : }
33376 0 : *out_start = start;
33377 0 : *out_end = end + itemsize;
33378 : }
33379 : static int
33380 0 : __pyx_slices_overlap(__Pyx_memviewslice *slice1,
33381 : __Pyx_memviewslice *slice2,
33382 : int ndim, size_t itemsize)
33383 : {
33384 0 : void *start1, *end1, *start2, *end2;
33385 0 : __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
33386 0 : __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
33387 0 : return (start1 < end2) && (start2 < end1);
33388 : }
33389 :
33390 : /* IsLittleEndian */
33391 0 : static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
33392 : {
33393 0 : union {
33394 : uint32_t u32;
33395 : uint8_t u8[4];
33396 : } S;
33397 0 : S.u32 = 0x01020304;
33398 0 : return S.u8[0] == 4;
33399 : }
33400 :
33401 : /* BufferFormatCheck */
33402 1964 : static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
33403 : __Pyx_BufFmt_StackElem* stack,
33404 : __Pyx_TypeInfo* type) {
33405 1964 : stack[0].field = &ctx->root;
33406 1964 : stack[0].parent_offset = 0;
33407 1964 : ctx->root.type = type;
33408 1964 : ctx->root.name = "buffer dtype";
33409 1964 : ctx->root.offset = 0;
33410 1964 : ctx->head = stack;
33411 1964 : ctx->head->field = &ctx->root;
33412 1964 : ctx->fmt_offset = 0;
33413 1964 : ctx->head->parent_offset = 0;
33414 1964 : ctx->new_packmode = '@';
33415 1964 : ctx->enc_packmode = '@';
33416 1964 : ctx->new_count = 1;
33417 1964 : ctx->enc_count = 0;
33418 1964 : ctx->enc_type = 0;
33419 1964 : ctx->is_complex = 0;
33420 1964 : ctx->is_valid_array = 0;
33421 1964 : ctx->struct_alignment = 0;
33422 1964 : while (type->typegroup == 'S') {
33423 0 : ++ctx->head;
33424 0 : ctx->head->field = type->fields;
33425 0 : ctx->head->parent_offset = 0;
33426 0 : type = type->fields->type;
33427 : }
33428 1964 : }
33429 0 : static int __Pyx_BufFmt_ParseNumber(const char** ts) {
33430 0 : int count;
33431 0 : const char* t = *ts;
33432 0 : if (*t < '0' || *t > '9') {
33433 : return -1;
33434 : } else {
33435 0 : count = *t++ - '0';
33436 0 : while (*t >= '0' && *t <= '9') {
33437 0 : count *= 10;
33438 0 : count += *t++ - '0';
33439 : }
33440 : }
33441 0 : *ts = t;
33442 0 : return count;
33443 : }
33444 0 : static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
33445 0 : int number = __Pyx_BufFmt_ParseNumber(ts);
33446 0 : if (number == -1)
33447 0 : PyErr_Format(PyExc_ValueError,\
33448 0 : "Does not understand character buffer dtype format string ('%c')", **ts);
33449 0 : return number;
33450 : }
33451 0 : static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
33452 0 : PyErr_Format(PyExc_ValueError,
33453 : "Unexpected format string character: '%c'", ch);
33454 : }
33455 0 : static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
33456 0 : switch (ch) {
33457 : case '?': return "'bool'";
33458 0 : case 'c': return "'char'";
33459 0 : case 'b': return "'signed char'";
33460 0 : case 'B': return "'unsigned char'";
33461 0 : case 'h': return "'short'";
33462 0 : case 'H': return "'unsigned short'";
33463 0 : case 'i': return "'int'";
33464 0 : case 'I': return "'unsigned int'";
33465 0 : case 'l': return "'long'";
33466 0 : case 'L': return "'unsigned long'";
33467 0 : case 'q': return "'long long'";
33468 0 : case 'Q': return "'unsigned long long'";
33469 0 : case 'f': return (is_complex ? "'complex float'" : "'float'");
33470 0 : case 'd': return (is_complex ? "'complex double'" : "'double'");
33471 0 : case 'g': return (is_complex ? "'complex long double'" : "'long double'");
33472 0 : case 'T': return "a struct";
33473 0 : case 'O': return "Python object";
33474 0 : case 'P': return "a pointer";
33475 0 : case 's': case 'p': return "a string";
33476 0 : case 0: return "end";
33477 0 : default: return "unparsable format string";
33478 : }
33479 : }
33480 0 : static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
33481 0 : switch (ch) {
33482 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
33483 0 : case 'h': case 'H': return 2;
33484 : case 'i': case 'I': case 'l': case 'L': return 4;
33485 : case 'q': case 'Q': return 8;
33486 0 : case 'f': return (is_complex ? 8 : 4);
33487 0 : case 'd': return (is_complex ? 16 : 8);
33488 0 : case 'g': {
33489 0 : PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
33490 0 : return 0;
33491 : }
33492 : case 'O': case 'P': return sizeof(void*);
33493 0 : default:
33494 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33495 0 : return 0;
33496 : }
33497 : }
33498 1964 : static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
33499 1964 : switch (ch) {
33500 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
33501 0 : case 'h': case 'H': return sizeof(short);
33502 : case 'i': case 'I': return sizeof(int);
33503 : case 'l': case 'L': return sizeof(long);
33504 : #ifdef HAVE_LONG_LONG
33505 : case 'q': case 'Q': return sizeof(PY_LONG_LONG);
33506 : #endif
33507 0 : case 'f': return sizeof(float) * (is_complex ? 2 : 1);
33508 272 : case 'd': return sizeof(double) * (is_complex ? 2 : 1);
33509 0 : case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
33510 : case 'O': case 'P': return sizeof(void*);
33511 0 : default: {
33512 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33513 0 : return 0;
33514 : }
33515 : }
33516 : }
33517 : typedef struct { char c; short x; } __Pyx_st_short;
33518 : typedef struct { char c; int x; } __Pyx_st_int;
33519 : typedef struct { char c; long x; } __Pyx_st_long;
33520 : typedef struct { char c; float x; } __Pyx_st_float;
33521 : typedef struct { char c; double x; } __Pyx_st_double;
33522 : typedef struct { char c; long double x; } __Pyx_st_longdouble;
33523 : typedef struct { char c; void *x; } __Pyx_st_void_p;
33524 : #ifdef HAVE_LONG_LONG
33525 : typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
33526 : #endif
33527 1964 : static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
33528 1964 : CYTHON_UNUSED_VAR(is_complex);
33529 1964 : switch (ch) {
33530 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
33531 0 : case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
33532 : case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
33533 : case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
33534 : #ifdef HAVE_LONG_LONG
33535 : case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
33536 : #endif
33537 : case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
33538 : case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
33539 0 : case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
33540 : case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
33541 0 : default:
33542 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33543 0 : return 0;
33544 : }
33545 : }
33546 : /* These are for computing the padding at the end of the struct to align
33547 : on the first member of the struct. This will probably the same as above,
33548 : but we don't have any guarantees.
33549 : */
33550 : typedef struct { short x; char c; } __Pyx_pad_short;
33551 : typedef struct { int x; char c; } __Pyx_pad_int;
33552 : typedef struct { long x; char c; } __Pyx_pad_long;
33553 : typedef struct { float x; char c; } __Pyx_pad_float;
33554 : typedef struct { double x; char c; } __Pyx_pad_double;
33555 : typedef struct { long double x; char c; } __Pyx_pad_longdouble;
33556 : typedef struct { void *x; char c; } __Pyx_pad_void_p;
33557 : #ifdef HAVE_LONG_LONG
33558 : typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
33559 : #endif
33560 1964 : static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
33561 1964 : CYTHON_UNUSED_VAR(is_complex);
33562 1964 : switch (ch) {
33563 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
33564 0 : case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
33565 : case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
33566 : case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
33567 : #ifdef HAVE_LONG_LONG
33568 : case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
33569 : #endif
33570 : case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
33571 : case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
33572 0 : case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
33573 : case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
33574 0 : default:
33575 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33576 0 : return 0;
33577 : }
33578 : }
33579 1964 : static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
33580 1964 : switch (ch) {
33581 : case 'c':
33582 : return 'H';
33583 1556 : case 'b': case 'h': case 'i':
33584 : case 'l': case 'q': case 's': case 'p':
33585 1556 : return 'I';
33586 136 : case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
33587 136 : return 'U';
33588 272 : case 'f': case 'd': case 'g':
33589 272 : return (is_complex ? 'C' : 'R');
33590 0 : case 'O':
33591 0 : return 'O';
33592 0 : case 'P':
33593 0 : return 'P';
33594 0 : default: {
33595 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33596 0 : return 0;
33597 : }
33598 : }
33599 : }
33600 0 : static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
33601 0 : if (ctx->head == NULL || ctx->head->field == &ctx->root) {
33602 0 : const char* expected;
33603 0 : const char* quote;
33604 0 : if (ctx->head == NULL) {
33605 : expected = "end";
33606 : quote = "";
33607 : } else {
33608 0 : expected = ctx->head->field->type->name;
33609 0 : quote = "'";
33610 : }
33611 0 : PyErr_Format(PyExc_ValueError,
33612 : "Buffer dtype mismatch, expected %s%s%s but got %s",
33613 : quote, expected, quote,
33614 0 : __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
33615 : } else {
33616 0 : __Pyx_StructField* field = ctx->head->field;
33617 0 : __Pyx_StructField* parent = (ctx->head - 1)->field;
33618 0 : PyErr_Format(PyExc_ValueError,
33619 : "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
33620 0 : field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
33621 0 : parent->type->name, field->name);
33622 : }
33623 0 : }
33624 3928 : static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
33625 3928 : char group;
33626 3928 : size_t size, offset, arraysize = 1;
33627 3928 : if (ctx->enc_type == 0) return 0;
33628 1964 : if (ctx->head->field->type->arraysize[0]) {
33629 0 : int i, ndim = 0;
33630 0 : if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
33631 0 : ctx->is_valid_array = ctx->head->field->type->ndim == 1;
33632 0 : ndim = 1;
33633 0 : if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
33634 0 : PyErr_Format(PyExc_ValueError,
33635 : "Expected a dimension of size %zu, got %zu",
33636 : ctx->head->field->type->arraysize[0], ctx->enc_count);
33637 0 : return -1;
33638 : }
33639 : }
33640 0 : if (!ctx->is_valid_array) {
33641 0 : PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
33642 : ctx->head->field->type->ndim, ndim);
33643 0 : return -1;
33644 : }
33645 0 : for (i = 0; i < ctx->head->field->type->ndim; i++) {
33646 0 : arraysize *= ctx->head->field->type->arraysize[i];
33647 : }
33648 0 : ctx->is_valid_array = 0;
33649 0 : ctx->enc_count = 1;
33650 : }
33651 1964 : group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
33652 1964 : do {
33653 1964 : __Pyx_StructField* field = ctx->head->field;
33654 1964 : __Pyx_TypeInfo* type = field->type;
33655 1964 : if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
33656 1964 : size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
33657 : } else {
33658 0 : size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
33659 : }
33660 1964 : if (ctx->enc_packmode == '@') {
33661 1964 : size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
33662 1964 : size_t align_mod_offset;
33663 1964 : if (align_at == 0) return -1;
33664 1964 : align_mod_offset = ctx->fmt_offset % align_at;
33665 1964 : if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
33666 1964 : if (ctx->struct_alignment == 0)
33667 1964 : ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
33668 : ctx->is_complex);
33669 : }
33670 1964 : if (type->size != size || type->typegroup != group) {
33671 0 : if (type->typegroup == 'C' && type->fields != NULL) {
33672 0 : size_t parent_offset = ctx->head->parent_offset + field->offset;
33673 0 : ++ctx->head;
33674 0 : ctx->head->field = type->fields;
33675 0 : ctx->head->parent_offset = parent_offset;
33676 0 : continue;
33677 : }
33678 0 : if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
33679 : } else {
33680 0 : __Pyx_BufFmt_RaiseExpected(ctx);
33681 0 : return -1;
33682 : }
33683 : }
33684 1964 : offset = ctx->head->parent_offset + field->offset;
33685 1964 : if (ctx->fmt_offset != offset) {
33686 0 : PyErr_Format(PyExc_ValueError,
33687 : "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
33688 : (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
33689 0 : return -1;
33690 : }
33691 1964 : ctx->fmt_offset += size;
33692 1964 : if (arraysize)
33693 1964 : ctx->fmt_offset += (arraysize - 1) * size;
33694 1964 : --ctx->enc_count;
33695 1964 : while (1) {
33696 1964 : if (field == &ctx->root) {
33697 1964 : ctx->head = NULL;
33698 1964 : if (ctx->enc_count != 0) {
33699 0 : __Pyx_BufFmt_RaiseExpected(ctx);
33700 0 : return -1;
33701 : }
33702 : break;
33703 : }
33704 0 : ctx->head->field = ++field;
33705 0 : if (field->type == NULL) {
33706 0 : --ctx->head;
33707 0 : field = ctx->head->field;
33708 0 : continue;
33709 0 : } else if (field->type->typegroup == 'S') {
33710 0 : size_t parent_offset = ctx->head->parent_offset + field->offset;
33711 0 : if (field->type->fields->type == NULL) continue;
33712 0 : field = field->type->fields;
33713 0 : ++ctx->head;
33714 0 : ctx->head->field = field;
33715 0 : ctx->head->parent_offset = parent_offset;
33716 0 : break;
33717 : } else {
33718 : break;
33719 : }
33720 : }
33721 1964 : } while (ctx->enc_count);
33722 1964 : ctx->enc_type = 0;
33723 1964 : ctx->is_complex = 0;
33724 1964 : return 0;
33725 : }
33726 : static int
33727 0 : __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
33728 : {
33729 0 : const char *ts = *tsp;
33730 0 : int i = 0, number, ndim;
33731 0 : ++ts;
33732 0 : if (ctx->new_count != 1) {
33733 0 : PyErr_SetString(PyExc_ValueError,
33734 : "Cannot handle repeated arrays in format string");
33735 0 : return -1;
33736 : }
33737 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
33738 0 : ndim = ctx->head->field->type->ndim;
33739 0 : while (*ts && *ts != ')') {
33740 0 : switch (*ts) {
33741 0 : case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
33742 0 : default: break;
33743 : }
33744 0 : number = __Pyx_BufFmt_ExpectNumber(&ts);
33745 0 : if (number == -1) return -1;
33746 0 : if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
33747 0 : PyErr_Format(PyExc_ValueError,
33748 : "Expected a dimension of size %zu, got %d",
33749 : ctx->head->field->type->arraysize[i], number);
33750 0 : return -1;
33751 : }
33752 0 : if (*ts != ',' && *ts != ')') {
33753 0 : PyErr_Format(PyExc_ValueError,
33754 : "Expected a comma in format string, got '%c'", *ts);
33755 0 : return -1;
33756 : }
33757 0 : if (*ts == ',') ts++;
33758 0 : i++;
33759 : }
33760 0 : if (i != ndim) {
33761 0 : PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
33762 0 : ctx->head->field->type->ndim, i);
33763 0 : return -1;
33764 : }
33765 0 : if (!*ts) {
33766 0 : PyErr_SetString(PyExc_ValueError,
33767 : "Unexpected end of format string, expected ')'");
33768 0 : return -1;
33769 : }
33770 0 : ctx->is_valid_array = 1;
33771 0 : ctx->new_count = 1;
33772 0 : *tsp = ++ts;
33773 0 : return 0;
33774 : }
33775 1964 : static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
33776 1964 : int got_Z = 0;
33777 3928 : while (1) {
33778 3928 : switch(*ts) {
33779 1964 : case 0:
33780 1964 : if (ctx->enc_type != 0 && ctx->head == NULL) {
33781 0 : __Pyx_BufFmt_RaiseExpected(ctx);
33782 0 : return NULL;
33783 : }
33784 1964 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33785 1964 : if (ctx->head != NULL) {
33786 0 : __Pyx_BufFmt_RaiseExpected(ctx);
33787 0 : return NULL;
33788 : }
33789 : return ts;
33790 0 : case ' ':
33791 : case '\r':
33792 : case '\n':
33793 0 : ++ts;
33794 0 : break;
33795 : case '<':
33796 0 : if (!__Pyx_Is_Little_Endian()) {
33797 : PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
33798 : return NULL;
33799 : }
33800 0 : ctx->new_packmode = '=';
33801 0 : ++ts;
33802 0 : break;
33803 : case '>':
33804 : case '!':
33805 0 : if (__Pyx_Is_Little_Endian()) {
33806 0 : PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
33807 0 : return NULL;
33808 : }
33809 : ctx->new_packmode = '=';
33810 : ++ts;
33811 : break;
33812 0 : case '=':
33813 : case '@':
33814 : case '^':
33815 0 : ctx->new_packmode = *ts++;
33816 0 : break;
33817 0 : case 'T':
33818 : {
33819 0 : const char* ts_after_sub;
33820 0 : size_t i, struct_count = ctx->new_count;
33821 0 : size_t struct_alignment = ctx->struct_alignment;
33822 0 : ctx->new_count = 1;
33823 0 : ++ts;
33824 0 : if (*ts != '{') {
33825 0 : PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
33826 0 : return NULL;
33827 : }
33828 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33829 0 : ctx->enc_type = 0;
33830 0 : ctx->enc_count = 0;
33831 0 : ctx->struct_alignment = 0;
33832 0 : ++ts;
33833 0 : ts_after_sub = ts;
33834 0 : for (i = 0; i != struct_count; ++i) {
33835 0 : ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
33836 0 : if (!ts_after_sub) return NULL;
33837 : }
33838 0 : ts = ts_after_sub;
33839 0 : if (struct_alignment) ctx->struct_alignment = struct_alignment;
33840 : }
33841 : break;
33842 0 : case '}':
33843 : {
33844 0 : size_t alignment = ctx->struct_alignment;
33845 0 : ++ts;
33846 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33847 0 : ctx->enc_type = 0;
33848 0 : if (alignment && ctx->fmt_offset % alignment) {
33849 0 : ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
33850 : }
33851 : }
33852 : return ts;
33853 0 : case 'x':
33854 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33855 0 : ctx->fmt_offset += ctx->new_count;
33856 0 : ctx->new_count = 1;
33857 0 : ctx->enc_count = 0;
33858 0 : ctx->enc_type = 0;
33859 0 : ctx->enc_packmode = ctx->new_packmode;
33860 0 : ++ts;
33861 0 : break;
33862 0 : case 'Z':
33863 0 : got_Z = 1;
33864 0 : ++ts;
33865 0 : if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
33866 0 : __Pyx_BufFmt_RaiseUnexpectedChar('Z');
33867 0 : return NULL;
33868 : }
33869 1964 : CYTHON_FALLTHROUGH;
33870 : case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
33871 : case 'l': case 'L': case 'q': case 'Q':
33872 : case 'f': case 'd': case 'g':
33873 : case 'O': case 'p':
33874 1964 : if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
33875 0 : (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
33876 0 : ctx->enc_count += ctx->new_count;
33877 0 : ctx->new_count = 1;
33878 0 : got_Z = 0;
33879 0 : ++ts;
33880 0 : break;
33881 : }
33882 1964 : CYTHON_FALLTHROUGH;
33883 : case 's':
33884 1964 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33885 1964 : ctx->enc_count = ctx->new_count;
33886 1964 : ctx->enc_packmode = ctx->new_packmode;
33887 1964 : ctx->enc_type = *ts;
33888 1964 : ctx->is_complex = got_Z;
33889 1964 : ++ts;
33890 1964 : ctx->new_count = 1;
33891 1964 : got_Z = 0;
33892 1964 : break;
33893 0 : case ':':
33894 0 : ++ts;
33895 0 : while(*ts != ':') ++ts;
33896 0 : ++ts;
33897 0 : break;
33898 0 : case '(':
33899 0 : if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
33900 : break;
33901 0 : default:
33902 : {
33903 0 : int number = __Pyx_BufFmt_ExpectNumber(&ts);
33904 0 : if (number == -1) return NULL;
33905 0 : ctx->new_count = (size_t)number;
33906 : }
33907 : }
33908 : }
33909 : }
33910 :
33911 : /* TypeInfoCompare */
33912 : static int
33913 0 : __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
33914 : {
33915 0 : int i;
33916 0 : if (!a || !b)
33917 : return 0;
33918 0 : if (a == b)
33919 : return 1;
33920 0 : if (a->size != b->size || a->typegroup != b->typegroup ||
33921 0 : a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
33922 0 : if (a->typegroup == 'H' || b->typegroup == 'H') {
33923 0 : return a->size == b->size;
33924 : } else {
33925 : return 0;
33926 : }
33927 : }
33928 0 : if (a->ndim) {
33929 0 : for (i = 0; i < a->ndim; i++)
33930 0 : if (a->arraysize[i] != b->arraysize[i])
33931 : return 0;
33932 : }
33933 0 : if (a->typegroup == 'S') {
33934 0 : if (a->flags != b->flags)
33935 : return 0;
33936 0 : if (a->fields || b->fields) {
33937 0 : if (!(a->fields && b->fields))
33938 : return 0;
33939 0 : for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
33940 0 : __Pyx_StructField *field_a = a->fields + i;
33941 0 : __Pyx_StructField *field_b = b->fields + i;
33942 0 : if (field_a->offset != field_b->offset ||
33943 0 : !__pyx_typeinfo_cmp(field_a->type, field_b->type))
33944 0 : return 0;
33945 : }
33946 0 : return !a->fields[i].type && !b->fields[i].type;
33947 : }
33948 : }
33949 : return 1;
33950 : }
33951 :
33952 : /* MemviewSliceValidateAndInit */
33953 : static int
33954 1910 : __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
33955 : {
33956 1910 : if (buf->shape[dim] <= 1)
33957 : return 1;
33958 1879 : if (buf->strides) {
33959 1879 : if (spec & __Pyx_MEMVIEW_CONTIG) {
33960 0 : if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
33961 0 : if (unlikely(buf->strides[dim] != sizeof(void *))) {
33962 0 : PyErr_Format(PyExc_ValueError,
33963 : "Buffer is not indirectly contiguous "
33964 : "in dimension %d.", dim);
33965 0 : goto fail;
33966 : }
33967 0 : } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
33968 0 : PyErr_SetString(PyExc_ValueError,
33969 : "Buffer and memoryview are not contiguous "
33970 : "in the same dimension.");
33971 0 : goto fail;
33972 : }
33973 : }
33974 1879 : if (spec & __Pyx_MEMVIEW_FOLLOW) {
33975 0 : Py_ssize_t stride = buf->strides[dim];
33976 0 : if (stride < 0)
33977 : stride = -stride;
33978 0 : if (unlikely(stride < buf->itemsize)) {
33979 0 : PyErr_SetString(PyExc_ValueError,
33980 : "Buffer and memoryview are not contiguous "
33981 : "in the same dimension.");
33982 0 : goto fail;
33983 : }
33984 : }
33985 : } else {
33986 0 : if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
33987 0 : PyErr_Format(PyExc_ValueError,
33988 : "C-contiguous buffer is not contiguous in "
33989 : "dimension %d", dim);
33990 0 : goto fail;
33991 0 : } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
33992 0 : PyErr_Format(PyExc_ValueError,
33993 : "C-contiguous buffer is not indirect in "
33994 : "dimension %d", dim);
33995 0 : goto fail;
33996 0 : } else if (unlikely(buf->suboffsets)) {
33997 0 : PyErr_SetString(PyExc_ValueError,
33998 : "Buffer exposes suboffsets but no strides");
33999 0 : goto fail;
34000 : }
34001 : }
34002 : return 1;
34003 : fail:
34004 : return 0;
34005 : }
34006 : static int
34007 1910 : __pyx_check_suboffsets(Py_buffer *buf, int dim, int ndim, int spec)
34008 : {
34009 1910 : CYTHON_UNUSED_VAR(ndim);
34010 1910 : if (spec & __Pyx_MEMVIEW_DIRECT) {
34011 1910 : if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
34012 0 : PyErr_Format(PyExc_ValueError,
34013 : "Buffer not compatible with direct access "
34014 : "in dimension %d.", dim);
34015 0 : goto fail;
34016 : }
34017 : }
34018 1910 : if (spec & __Pyx_MEMVIEW_PTR) {
34019 0 : if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
34020 0 : PyErr_Format(PyExc_ValueError,
34021 : "Buffer is not indirectly accessible "
34022 : "in dimension %d.", dim);
34023 0 : goto fail;
34024 : }
34025 : }
34026 : return 1;
34027 : fail:
34028 : return 0;
34029 : }
34030 : static int
34031 1910 : __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
34032 : {
34033 1910 : int i;
34034 1910 : if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
34035 : Py_ssize_t stride = 1;
34036 0 : for (i = 0; i < ndim; i++) {
34037 0 : if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
34038 0 : PyErr_SetString(PyExc_ValueError,
34039 : "Buffer not fortran contiguous.");
34040 0 : goto fail;
34041 : }
34042 0 : stride = stride * buf->shape[i];
34043 : }
34044 1910 : } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
34045 0 : Py_ssize_t stride = 1;
34046 0 : for (i = ndim - 1; i >- 1; i--) {
34047 0 : if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
34048 0 : PyErr_SetString(PyExc_ValueError,
34049 : "Buffer not C contiguous.");
34050 0 : goto fail;
34051 : }
34052 0 : stride = stride * buf->shape[i];
34053 : }
34054 : }
34055 : return 1;
34056 : fail:
34057 : return 0;
34058 : }
34059 1964 : static int __Pyx_ValidateAndInit_memviewslice(
34060 : int *axes_specs,
34061 : int c_or_f_flag,
34062 : int buf_flags,
34063 : int ndim,
34064 : __Pyx_TypeInfo *dtype,
34065 : __Pyx_BufFmt_StackElem stack[],
34066 : __Pyx_memviewslice *memviewslice,
34067 : PyObject *original_obj)
34068 : {
34069 1964 : struct __pyx_memoryview_obj *memview, *new_memview;
34070 : __Pyx_RefNannyDeclarations
34071 1964 : Py_buffer *buf;
34072 1964 : int i, spec = 0, retval = -1;
34073 1964 : __Pyx_BufFmt_Context ctx;
34074 1964 : int from_memoryview = __pyx_memoryview_check(original_obj);
34075 1964 : __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
34076 1964 : if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
34077 : original_obj)->typeinfo)) {
34078 : memview = (struct __pyx_memoryview_obj *) original_obj;
34079 : new_memview = NULL;
34080 : } else {
34081 1964 : memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
34082 : original_obj, buf_flags, 0, dtype);
34083 1964 : new_memview = memview;
34084 1964 : if (unlikely(!memview))
34085 0 : goto fail;
34086 : }
34087 1964 : buf = &memview->view;
34088 1964 : if (unlikely(buf->ndim != ndim)) {
34089 0 : PyErr_Format(PyExc_ValueError,
34090 : "Buffer has wrong number of dimensions (expected %d, got %d)",
34091 : ndim, buf->ndim);
34092 0 : goto fail;
34093 : }
34094 1964 : if (new_memview) {
34095 1964 : __Pyx_BufFmt_Init(&ctx, stack, dtype);
34096 1964 : if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
34097 : }
34098 1964 : if (unlikely((unsigned) buf->itemsize != dtype->size)) {
34099 0 : PyErr_Format(PyExc_ValueError,
34100 : "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
34101 : "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
34102 : buf->itemsize,
34103 : (buf->itemsize > 1) ? "s" : "",
34104 : dtype->name,
34105 : dtype->size,
34106 : (dtype->size > 1) ? "s" : "");
34107 0 : goto fail;
34108 : }
34109 1964 : if (buf->len > 0) {
34110 3820 : for (i = 0; i < ndim; i++) {
34111 1910 : spec = axes_specs[i];
34112 1910 : if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
34113 0 : goto fail;
34114 1910 : if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
34115 0 : goto fail;
34116 : }
34117 1910 : if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
34118 0 : goto fail;
34119 : }
34120 1964 : if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
34121 : new_memview != NULL) == -1)) {
34122 0 : goto fail;
34123 : }
34124 1964 : retval = 0;
34125 1964 : goto no_fail;
34126 0 : fail:
34127 0 : Py_XDECREF(new_memview);
34128 0 : retval = -1;
34129 1964 : no_fail:
34130 1964 : __Pyx_RefNannyFinishContext();
34131 1964 : return retval;
34132 : }
34133 :
34134 : /* ObjectToMemviewSlice */
34135 270 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t__const__(PyObject *obj, int writable_flag) {
34136 270 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
34137 270 : __Pyx_BufFmt_StackElem stack[1];
34138 270 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
34139 270 : int retcode;
34140 270 : if (obj == Py_None) {
34141 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
34142 0 : return result;
34143 : }
34144 270 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
34145 : PyBUF_RECORDS_RO | writable_flag, 1,
34146 : &__Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t__const__, stack,
34147 : &result, obj);
34148 270 : if (unlikely(retcode == -1))
34149 0 : goto __pyx_fail;
34150 270 : return result;
34151 0 : __pyx_fail:
34152 0 : result.memview = NULL;
34153 0 : result.data = NULL;
34154 0 : return result;
34155 : }
34156 :
34157 : /* CIntFromPyVerify */
34158 : #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
34159 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
34160 : #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
34161 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
34162 : #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
34163 : {\
34164 : func_type value = func_value;\
34165 : if (sizeof(target_type) < sizeof(func_type)) {\
34166 : if (unlikely(value != (func_type) (target_type) value)) {\
34167 : func_type zero = 0;\
34168 : if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
34169 : return (target_type) -1;\
34170 : if (is_unsigned && unlikely(value < zero))\
34171 : goto raise_neg_overflow;\
34172 : else\
34173 : goto raise_overflow;\
34174 : }\
34175 : }\
34176 : return (target_type) value;\
34177 : }
34178 :
34179 : /* ObjectToMemviewSlice */
34180 1286 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(PyObject *obj, int writable_flag) {
34181 1286 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
34182 1286 : __Pyx_BufFmt_StackElem stack[1];
34183 1286 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
34184 1286 : int retcode;
34185 1286 : if (obj == Py_None) {
34186 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
34187 0 : return result;
34188 : }
34189 1286 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
34190 : PyBUF_RECORDS_RO | writable_flag, 1,
34191 : &__Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t, stack,
34192 : &result, obj);
34193 1286 : if (unlikely(retcode == -1))
34194 0 : goto __pyx_fail;
34195 1286 : return result;
34196 0 : __pyx_fail:
34197 0 : result.memview = NULL;
34198 0 : result.data = NULL;
34199 0 : return result;
34200 : }
34201 :
34202 : /* MemviewDtypeToObject */
34203 0 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(const char *itemp) {
34204 0 : return (PyObject *) __Pyx_PyInt_From_npy_int32(*(__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) itemp);
34205 : }
34206 0 : static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t(const char *itemp, PyObject *obj) {
34207 0 : __pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t value = __Pyx_PyInt_As_npy_int32(obj);
34208 0 : if (unlikely((value == ((npy_int32)-1)) && PyErr_Occurred()))
34209 : return 0;
34210 0 : *(__pyx_t_5scipy_6sparse_7csgraph_9_matching_ITYPE_t *) itemp = value;
34211 0 : return 1;
34212 : }
34213 :
34214 : /* ObjectToMemviewSlice */
34215 272 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t(PyObject *obj, int writable_flag) {
34216 272 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
34217 272 : __Pyx_BufFmt_StackElem stack[1];
34218 272 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
34219 272 : int retcode;
34220 272 : if (obj == Py_None) {
34221 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
34222 0 : return result;
34223 : }
34224 272 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
34225 : PyBUF_RECORDS_RO | writable_flag, 1,
34226 : &__Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_DTYPE_t, stack,
34227 : &result, obj);
34228 272 : if (unlikely(retcode == -1))
34229 0 : goto __pyx_fail;
34230 272 : return result;
34231 0 : __pyx_fail:
34232 0 : result.memview = NULL;
34233 0 : result.data = NULL;
34234 0 : return result;
34235 : }
34236 :
34237 : /* ObjectToMemviewSlice */
34238 136 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t(PyObject *obj, int writable_flag) {
34239 136 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
34240 136 : __Pyx_BufFmt_StackElem stack[1];
34241 136 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
34242 136 : int retcode;
34243 136 : if (obj == Py_None) {
34244 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
34245 0 : return result;
34246 : }
34247 136 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
34248 : PyBUF_RECORDS_RO | writable_flag, 1,
34249 : &__Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_9_matching_BTYPE_t, stack,
34250 : &result, obj);
34251 136 : if (unlikely(retcode == -1))
34252 0 : goto __pyx_fail;
34253 136 : return result;
34254 0 : __pyx_fail:
34255 0 : result.memview = NULL;
34256 0 : result.data = NULL;
34257 0 : return result;
34258 : }
34259 :
34260 : /* Declarations */
34261 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34262 : #ifdef __cplusplus
34263 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
34264 : return ::std::complex< float >(x, y);
34265 : }
34266 : #else
34267 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
34268 : return x + y*(__pyx_t_float_complex)_Complex_I;
34269 : }
34270 : #endif
34271 : #else
34272 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
34273 : __pyx_t_float_complex z;
34274 : z.real = x;
34275 : z.imag = y;
34276 : return z;
34277 : }
34278 : #endif
34279 :
34280 : /* Arithmetic */
34281 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34282 : #else
34283 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34284 : return (a.real == b.real) && (a.imag == b.imag);
34285 : }
34286 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34287 : __pyx_t_float_complex z;
34288 : z.real = a.real + b.real;
34289 : z.imag = a.imag + b.imag;
34290 : return z;
34291 : }
34292 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34293 : __pyx_t_float_complex z;
34294 : z.real = a.real - b.real;
34295 : z.imag = a.imag - b.imag;
34296 : return z;
34297 : }
34298 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34299 : __pyx_t_float_complex z;
34300 : z.real = a.real * b.real - a.imag * b.imag;
34301 : z.imag = a.real * b.imag + a.imag * b.real;
34302 : return z;
34303 : }
34304 : #if 1
34305 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34306 : if (b.imag == 0) {
34307 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
34308 : } else if (fabsf(b.real) >= fabsf(b.imag)) {
34309 : if (b.real == 0 && b.imag == 0) {
34310 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
34311 : } else {
34312 : float r = b.imag / b.real;
34313 : float s = (float)(1.0) / (b.real + b.imag * r);
34314 : return __pyx_t_float_complex_from_parts(
34315 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
34316 : }
34317 : } else {
34318 : float r = b.real / b.imag;
34319 : float s = (float)(1.0) / (b.imag + b.real * r);
34320 : return __pyx_t_float_complex_from_parts(
34321 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
34322 : }
34323 : }
34324 : #else
34325 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34326 : if (b.imag == 0) {
34327 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
34328 : } else {
34329 : float denom = b.real * b.real + b.imag * b.imag;
34330 : return __pyx_t_float_complex_from_parts(
34331 : (a.real * b.real + a.imag * b.imag) / denom,
34332 : (a.imag * b.real - a.real * b.imag) / denom);
34333 : }
34334 : }
34335 : #endif
34336 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
34337 : __pyx_t_float_complex z;
34338 : z.real = -a.real;
34339 : z.imag = -a.imag;
34340 : return z;
34341 : }
34342 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
34343 : return (a.real == 0) && (a.imag == 0);
34344 : }
34345 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
34346 : __pyx_t_float_complex z;
34347 : z.real = a.real;
34348 : z.imag = -a.imag;
34349 : return z;
34350 : }
34351 : #if 1
34352 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
34353 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
34354 : return sqrtf(z.real*z.real + z.imag*z.imag);
34355 : #else
34356 : return hypotf(z.real, z.imag);
34357 : #endif
34358 : }
34359 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34360 : __pyx_t_float_complex z;
34361 : float r, lnr, theta, z_r, z_theta;
34362 : if (b.imag == 0 && b.real == (int)b.real) {
34363 : if (b.real < 0) {
34364 : float denom = a.real * a.real + a.imag * a.imag;
34365 : a.real = a.real / denom;
34366 : a.imag = -a.imag / denom;
34367 : b.real = -b.real;
34368 : }
34369 : switch ((int)b.real) {
34370 : case 0:
34371 : z.real = 1;
34372 : z.imag = 0;
34373 : return z;
34374 : case 1:
34375 : return a;
34376 : case 2:
34377 : return __Pyx_c_prod_float(a, a);
34378 : case 3:
34379 : z = __Pyx_c_prod_float(a, a);
34380 : return __Pyx_c_prod_float(z, a);
34381 : case 4:
34382 : z = __Pyx_c_prod_float(a, a);
34383 : return __Pyx_c_prod_float(z, z);
34384 : }
34385 : }
34386 : if (a.imag == 0) {
34387 : if (a.real == 0) {
34388 : return a;
34389 : } else if ((b.imag == 0) && (a.real >= 0)) {
34390 : z.real = powf(a.real, b.real);
34391 : z.imag = 0;
34392 : return z;
34393 : } else if (a.real > 0) {
34394 : r = a.real;
34395 : theta = 0;
34396 : } else {
34397 : r = -a.real;
34398 : theta = atan2f(0.0, -1.0);
34399 : }
34400 : } else {
34401 : r = __Pyx_c_abs_float(a);
34402 : theta = atan2f(a.imag, a.real);
34403 : }
34404 : lnr = logf(r);
34405 : z_r = expf(lnr * b.real - theta * b.imag);
34406 : z_theta = theta * b.real + lnr * b.imag;
34407 : z.real = z_r * cosf(z_theta);
34408 : z.imag = z_r * sinf(z_theta);
34409 : return z;
34410 : }
34411 : #endif
34412 : #endif
34413 :
34414 : /* Declarations */
34415 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34416 : #ifdef __cplusplus
34417 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
34418 : return ::std::complex< double >(x, y);
34419 : }
34420 : #else
34421 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
34422 : return x + y*(__pyx_t_double_complex)_Complex_I;
34423 : }
34424 : #endif
34425 : #else
34426 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
34427 : __pyx_t_double_complex z;
34428 : z.real = x;
34429 : z.imag = y;
34430 : return z;
34431 : }
34432 : #endif
34433 :
34434 : /* Arithmetic */
34435 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34436 : #else
34437 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34438 : return (a.real == b.real) && (a.imag == b.imag);
34439 : }
34440 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34441 : __pyx_t_double_complex z;
34442 : z.real = a.real + b.real;
34443 : z.imag = a.imag + b.imag;
34444 : return z;
34445 : }
34446 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34447 : __pyx_t_double_complex z;
34448 : z.real = a.real - b.real;
34449 : z.imag = a.imag - b.imag;
34450 : return z;
34451 : }
34452 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34453 : __pyx_t_double_complex z;
34454 : z.real = a.real * b.real - a.imag * b.imag;
34455 : z.imag = a.real * b.imag + a.imag * b.real;
34456 : return z;
34457 : }
34458 : #if 1
34459 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34460 : if (b.imag == 0) {
34461 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34462 : } else if (fabs(b.real) >= fabs(b.imag)) {
34463 : if (b.real == 0 && b.imag == 0) {
34464 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
34465 : } else {
34466 : double r = b.imag / b.real;
34467 : double s = (double)(1.0) / (b.real + b.imag * r);
34468 : return __pyx_t_double_complex_from_parts(
34469 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
34470 : }
34471 : } else {
34472 : double r = b.real / b.imag;
34473 : double s = (double)(1.0) / (b.imag + b.real * r);
34474 : return __pyx_t_double_complex_from_parts(
34475 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
34476 : }
34477 : }
34478 : #else
34479 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34480 : if (b.imag == 0) {
34481 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34482 : } else {
34483 : double denom = b.real * b.real + b.imag * b.imag;
34484 : return __pyx_t_double_complex_from_parts(
34485 : (a.real * b.real + a.imag * b.imag) / denom,
34486 : (a.imag * b.real - a.real * b.imag) / denom);
34487 : }
34488 : }
34489 : #endif
34490 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
34491 : __pyx_t_double_complex z;
34492 : z.real = -a.real;
34493 : z.imag = -a.imag;
34494 : return z;
34495 : }
34496 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
34497 : return (a.real == 0) && (a.imag == 0);
34498 : }
34499 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
34500 : __pyx_t_double_complex z;
34501 : z.real = a.real;
34502 : z.imag = -a.imag;
34503 : return z;
34504 : }
34505 : #if 1
34506 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
34507 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
34508 : return sqrt(z.real*z.real + z.imag*z.imag);
34509 : #else
34510 : return hypot(z.real, z.imag);
34511 : #endif
34512 : }
34513 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34514 : __pyx_t_double_complex z;
34515 : double r, lnr, theta, z_r, z_theta;
34516 : if (b.imag == 0 && b.real == (int)b.real) {
34517 : if (b.real < 0) {
34518 : double denom = a.real * a.real + a.imag * a.imag;
34519 : a.real = a.real / denom;
34520 : a.imag = -a.imag / denom;
34521 : b.real = -b.real;
34522 : }
34523 : switch ((int)b.real) {
34524 : case 0:
34525 : z.real = 1;
34526 : z.imag = 0;
34527 : return z;
34528 : case 1:
34529 : return a;
34530 : case 2:
34531 : return __Pyx_c_prod_double(a, a);
34532 : case 3:
34533 : z = __Pyx_c_prod_double(a, a);
34534 : return __Pyx_c_prod_double(z, a);
34535 : case 4:
34536 : z = __Pyx_c_prod_double(a, a);
34537 : return __Pyx_c_prod_double(z, z);
34538 : }
34539 : }
34540 : if (a.imag == 0) {
34541 : if (a.real == 0) {
34542 : return a;
34543 : } else if ((b.imag == 0) && (a.real >= 0)) {
34544 : z.real = pow(a.real, b.real);
34545 : z.imag = 0;
34546 : return z;
34547 : } else if (a.real > 0) {
34548 : r = a.real;
34549 : theta = 0;
34550 : } else {
34551 : r = -a.real;
34552 : theta = atan2(0.0, -1.0);
34553 : }
34554 : } else {
34555 : r = __Pyx_c_abs_double(a);
34556 : theta = atan2(a.imag, a.real);
34557 : }
34558 : lnr = log(r);
34559 : z_r = exp(lnr * b.real - theta * b.imag);
34560 : z_theta = theta * b.real + lnr * b.imag;
34561 : z.real = z_r * cos(z_theta);
34562 : z.imag = z_r * sin(z_theta);
34563 : return z;
34564 : }
34565 : #endif
34566 : #endif
34567 :
34568 : /* Declarations */
34569 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34570 : #ifdef __cplusplus
34571 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
34572 : return ::std::complex< long double >(x, y);
34573 : }
34574 : #else
34575 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
34576 : return x + y*(__pyx_t_long_double_complex)_Complex_I;
34577 : }
34578 : #endif
34579 : #else
34580 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
34581 : __pyx_t_long_double_complex z;
34582 : z.real = x;
34583 : z.imag = y;
34584 : return z;
34585 : }
34586 : #endif
34587 :
34588 : /* Arithmetic */
34589 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34590 : #else
34591 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34592 : return (a.real == b.real) && (a.imag == b.imag);
34593 : }
34594 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34595 : __pyx_t_long_double_complex z;
34596 : z.real = a.real + b.real;
34597 : z.imag = a.imag + b.imag;
34598 : return z;
34599 : }
34600 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34601 : __pyx_t_long_double_complex z;
34602 : z.real = a.real - b.real;
34603 : z.imag = a.imag - b.imag;
34604 : return z;
34605 : }
34606 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34607 : __pyx_t_long_double_complex z;
34608 : z.real = a.real * b.real - a.imag * b.imag;
34609 : z.imag = a.real * b.imag + a.imag * b.real;
34610 : return z;
34611 : }
34612 : #if 1
34613 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34614 : if (b.imag == 0) {
34615 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34616 : } else if (fabsl(b.real) >= fabsl(b.imag)) {
34617 : if (b.real == 0 && b.imag == 0) {
34618 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
34619 : } else {
34620 : long double r = b.imag / b.real;
34621 : long double s = (long double)(1.0) / (b.real + b.imag * r);
34622 : return __pyx_t_long_double_complex_from_parts(
34623 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
34624 : }
34625 : } else {
34626 : long double r = b.real / b.imag;
34627 : long double s = (long double)(1.0) / (b.imag + b.real * r);
34628 : return __pyx_t_long_double_complex_from_parts(
34629 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
34630 : }
34631 : }
34632 : #else
34633 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34634 : if (b.imag == 0) {
34635 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34636 : } else {
34637 : long double denom = b.real * b.real + b.imag * b.imag;
34638 : return __pyx_t_long_double_complex_from_parts(
34639 : (a.real * b.real + a.imag * b.imag) / denom,
34640 : (a.imag * b.real - a.real * b.imag) / denom);
34641 : }
34642 : }
34643 : #endif
34644 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
34645 : __pyx_t_long_double_complex z;
34646 : z.real = -a.real;
34647 : z.imag = -a.imag;
34648 : return z;
34649 : }
34650 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
34651 : return (a.real == 0) && (a.imag == 0);
34652 : }
34653 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
34654 : __pyx_t_long_double_complex z;
34655 : z.real = a.real;
34656 : z.imag = -a.imag;
34657 : return z;
34658 : }
34659 : #if 1
34660 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
34661 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
34662 : return sqrtl(z.real*z.real + z.imag*z.imag);
34663 : #else
34664 : return hypotl(z.real, z.imag);
34665 : #endif
34666 : }
34667 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34668 : __pyx_t_long_double_complex z;
34669 : long double r, lnr, theta, z_r, z_theta;
34670 : if (b.imag == 0 && b.real == (int)b.real) {
34671 : if (b.real < 0) {
34672 : long double denom = a.real * a.real + a.imag * a.imag;
34673 : a.real = a.real / denom;
34674 : a.imag = -a.imag / denom;
34675 : b.real = -b.real;
34676 : }
34677 : switch ((int)b.real) {
34678 : case 0:
34679 : z.real = 1;
34680 : z.imag = 0;
34681 : return z;
34682 : case 1:
34683 : return a;
34684 : case 2:
34685 : return __Pyx_c_prod_long__double(a, a);
34686 : case 3:
34687 : z = __Pyx_c_prod_long__double(a, a);
34688 : return __Pyx_c_prod_long__double(z, a);
34689 : case 4:
34690 : z = __Pyx_c_prod_long__double(a, a);
34691 : return __Pyx_c_prod_long__double(z, z);
34692 : }
34693 : }
34694 : if (a.imag == 0) {
34695 : if (a.real == 0) {
34696 : return a;
34697 : } else if ((b.imag == 0) && (a.real >= 0)) {
34698 : z.real = powl(a.real, b.real);
34699 : z.imag = 0;
34700 : return z;
34701 : } else if (a.real > 0) {
34702 : r = a.real;
34703 : theta = 0;
34704 : } else {
34705 : r = -a.real;
34706 : theta = atan2l(0.0, -1.0);
34707 : }
34708 : } else {
34709 : r = __Pyx_c_abs_long__double(a);
34710 : theta = atan2l(a.imag, a.real);
34711 : }
34712 : lnr = logl(r);
34713 : z_r = expl(lnr * b.real - theta * b.imag);
34714 : z_theta = theta * b.real + lnr * b.imag;
34715 : z.real = z_r * cosl(z_theta);
34716 : z.imag = z_r * sinl(z_theta);
34717 : return z;
34718 : }
34719 : #endif
34720 : #endif
34721 :
34722 : /* MemviewSliceCopyTemplate */
34723 : static __Pyx_memviewslice
34724 0 : __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
34725 : const char *mode, int ndim,
34726 : size_t sizeof_dtype, int contig_flag,
34727 : int dtype_is_object)
34728 : {
34729 : __Pyx_RefNannyDeclarations
34730 0 : int i;
34731 0 : __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
34732 0 : struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
34733 0 : Py_buffer *buf = &from_memview->view;
34734 0 : PyObject *shape_tuple = NULL;
34735 0 : PyObject *temp_int = NULL;
34736 0 : struct __pyx_array_obj *array_obj = NULL;
34737 0 : struct __pyx_memoryview_obj *memview_obj = NULL;
34738 0 : __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
34739 0 : for (i = 0; i < ndim; i++) {
34740 0 : if (unlikely(from_mvs->suboffsets[i] >= 0)) {
34741 0 : PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
34742 : "indirect dimensions (axis %d)", i);
34743 0 : goto fail;
34744 : }
34745 : }
34746 0 : shape_tuple = PyTuple_New(ndim);
34747 0 : if (unlikely(!shape_tuple)) {
34748 0 : goto fail;
34749 : }
34750 : __Pyx_GOTREF(shape_tuple);
34751 0 : for(i = 0; i < ndim; i++) {
34752 0 : temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
34753 0 : if(unlikely(!temp_int)) {
34754 0 : goto fail;
34755 : } else {
34756 0 : PyTuple_SET_ITEM(shape_tuple, i, temp_int);
34757 0 : temp_int = NULL;
34758 : }
34759 : }
34760 0 : array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
34761 0 : if (unlikely(!array_obj)) {
34762 0 : goto fail;
34763 : }
34764 0 : __Pyx_GOTREF(array_obj);
34765 0 : memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
34766 : (PyObject *) array_obj, contig_flag,
34767 : dtype_is_object,
34768 0 : from_mvs->memview->typeinfo);
34769 0 : if (unlikely(!memview_obj))
34770 0 : goto fail;
34771 0 : if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
34772 0 : goto fail;
34773 0 : if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
34774 : dtype_is_object) < 0))
34775 0 : goto fail;
34776 0 : goto no_fail;
34777 0 : fail:
34778 0 : __Pyx_XDECREF(new_mvs.memview);
34779 0 : new_mvs.memview = NULL;
34780 0 : new_mvs.data = NULL;
34781 0 : no_fail:
34782 0 : __Pyx_XDECREF(shape_tuple);
34783 0 : __Pyx_XDECREF(temp_int);
34784 0 : __Pyx_XDECREF(array_obj);
34785 0 : __Pyx_RefNannyFinishContext();
34786 0 : return new_mvs;
34787 : }
34788 :
34789 : /* MemviewSliceInit */
34790 : static int
34791 1964 : __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
34792 : int ndim,
34793 : __Pyx_memviewslice *memviewslice,
34794 : int memview_is_new_reference)
34795 : {
34796 : __Pyx_RefNannyDeclarations
34797 1964 : int i, retval=-1;
34798 1964 : Py_buffer *buf = &memview->view;
34799 1964 : __Pyx_RefNannySetupContext("init_memviewslice", 0);
34800 1964 : if (unlikely(memviewslice->memview || memviewslice->data)) {
34801 0 : PyErr_SetString(PyExc_ValueError,
34802 : "memviewslice is already initialized!");
34803 0 : goto fail;
34804 : }
34805 1964 : if (buf->strides) {
34806 3928 : for (i = 0; i < ndim; i++) {
34807 1964 : memviewslice->strides[i] = buf->strides[i];
34808 : }
34809 : } else {
34810 0 : Py_ssize_t stride = buf->itemsize;
34811 0 : for (i = ndim - 1; i >= 0; i--) {
34812 0 : memviewslice->strides[i] = stride;
34813 0 : stride *= buf->shape[i];
34814 : }
34815 : }
34816 3928 : for (i = 0; i < ndim; i++) {
34817 1964 : memviewslice->shape[i] = buf->shape[i];
34818 1964 : if (buf->suboffsets) {
34819 0 : memviewslice->suboffsets[i] = buf->suboffsets[i];
34820 : } else {
34821 1964 : memviewslice->suboffsets[i] = -1;
34822 : }
34823 : }
34824 1964 : memviewslice->memview = memview;
34825 1964 : memviewslice->data = (char *)buf->buf;
34826 1964 : if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
34827 0 : Py_INCREF(memview);
34828 : }
34829 1964 : retval = 0;
34830 1964 : goto no_fail;
34831 0 : fail:
34832 0 : memviewslice->memview = 0;
34833 0 : memviewslice->data = 0;
34834 0 : retval = -1;
34835 1964 : no_fail:
34836 1964 : __Pyx_RefNannyFinishContext();
34837 1964 : return retval;
34838 : }
34839 : #ifndef Py_NO_RETURN
34840 : #define Py_NO_RETURN
34841 : #endif
34842 0 : static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
34843 0 : va_list vargs;
34844 0 : char msg[200];
34845 : #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
34846 0 : va_start(vargs, fmt);
34847 : #else
34848 : va_start(vargs);
34849 : #endif
34850 0 : vsnprintf(msg, 200, fmt, vargs);
34851 0 : va_end(vargs);
34852 0 : Py_FatalError(msg);
34853 : }
34854 : static CYTHON_INLINE int
34855 : __pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
34856 : PyThread_type_lock lock)
34857 : {
34858 : int result;
34859 : PyThread_acquire_lock(lock, 1);
34860 : result = (*acquisition_count)++;
34861 : PyThread_release_lock(lock);
34862 : return result;
34863 : }
34864 : static CYTHON_INLINE int
34865 : __pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
34866 : PyThread_type_lock lock)
34867 : {
34868 : int result;
34869 : PyThread_acquire_lock(lock, 1);
34870 : result = (*acquisition_count)--;
34871 : PyThread_release_lock(lock);
34872 : return result;
34873 : }
34874 : static CYTHON_INLINE void
34875 406 : __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
34876 : {
34877 406 : __pyx_nonatomic_int_type old_acquisition_count;
34878 406 : struct __pyx_memoryview_obj *memview = memslice->memview;
34879 406 : if (unlikely(!memview || (PyObject *) memview == Py_None)) {
34880 : return;
34881 : }
34882 406 : old_acquisition_count = __pyx_add_acquisition_count(memview);
34883 406 : if (unlikely(old_acquisition_count <= 0)) {
34884 0 : if (likely(old_acquisition_count == 0)) {
34885 0 : if (have_gil) {
34886 0 : Py_INCREF((PyObject *) memview);
34887 : } else {
34888 0 : PyGILState_STATE _gilstate = PyGILState_Ensure();
34889 0 : Py_INCREF((PyObject *) memview);
34890 0 : PyGILState_Release(_gilstate);
34891 : }
34892 : } else {
34893 0 : __pyx_fatalerror("Acquisition count is %d (line %d)",
34894 : old_acquisition_count+1, lineno);
34895 : }
34896 : }
34897 : }
34898 2630 : static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
34899 : int have_gil, int lineno) {
34900 2630 : __pyx_nonatomic_int_type old_acquisition_count;
34901 2630 : struct __pyx_memoryview_obj *memview = memslice->memview;
34902 2630 : if (unlikely(!memview || (PyObject *) memview == Py_None)) {
34903 260 : memslice->memview = NULL;
34904 260 : return;
34905 : }
34906 2370 : old_acquisition_count = __pyx_sub_acquisition_count(memview);
34907 2370 : memslice->data = NULL;
34908 2370 : if (likely(old_acquisition_count > 1)) {
34909 406 : memslice->memview = NULL;
34910 1964 : } else if (likely(old_acquisition_count == 1)) {
34911 1964 : if (have_gil) {
34912 1964 : Py_CLEAR(memslice->memview);
34913 : } else {
34914 0 : PyGILState_STATE _gilstate = PyGILState_Ensure();
34915 0 : Py_CLEAR(memslice->memview);
34916 0 : PyGILState_Release(_gilstate);
34917 : }
34918 : } else {
34919 0 : __pyx_fatalerror("Acquisition count is %d (line %d)",
34920 : old_acquisition_count-1, lineno);
34921 : }
34922 : }
34923 :
34924 : /* CIntFromPy */
34925 541 : static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
34926 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34927 : #pragma GCC diagnostic push
34928 : #pragma GCC diagnostic ignored "-Wconversion"
34929 : #endif
34930 541 : const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
34931 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34932 : #pragma GCC diagnostic pop
34933 : #endif
34934 541 : const int is_unsigned = neg_one > const_zero;
34935 : #if PY_MAJOR_VERSION < 3
34936 : if (likely(PyInt_Check(x))) {
34937 : if ((sizeof(npy_int32) < sizeof(long))) {
34938 : __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
34939 : } else {
34940 : long val = PyInt_AS_LONG(x);
34941 : if (is_unsigned && unlikely(val < 0)) {
34942 : goto raise_neg_overflow;
34943 : }
34944 : return (npy_int32) val;
34945 : }
34946 : }
34947 : #endif
34948 541 : if (unlikely(!PyLong_Check(x))) {
34949 0 : npy_int32 val;
34950 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
34951 0 : if (!tmp) return (npy_int32) -1;
34952 0 : val = __Pyx_PyInt_As_npy_int32(tmp);
34953 0 : Py_DECREF(tmp);
34954 0 : return val;
34955 : }
34956 541 : if (is_unsigned) {
34957 : #if CYTHON_USE_PYLONG_INTERNALS
34958 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
34959 : goto raise_neg_overflow;
34960 : } else if (__Pyx_PyLong_IsCompact(x)) {
34961 : __PYX_VERIFY_RETURN_INT(npy_int32, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
34962 : } else {
34963 : const digit* digits = __Pyx_PyLong_Digits(x);
34964 : assert(__Pyx_PyLong_DigitCount(x) > 1);
34965 : switch (__Pyx_PyLong_DigitCount(x)) {
34966 : case 2:
34967 : if ((8 * sizeof(npy_int32) > 1 * PyLong_SHIFT)) {
34968 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
34969 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34970 : } else if ((8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT)) {
34971 : return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
34972 : }
34973 : }
34974 : break;
34975 : case 3:
34976 : if ((8 * sizeof(npy_int32) > 2 * PyLong_SHIFT)) {
34977 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
34978 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34979 : } else if ((8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT)) {
34980 : return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
34981 : }
34982 : }
34983 : break;
34984 : case 4:
34985 : if ((8 * sizeof(npy_int32) > 3 * PyLong_SHIFT)) {
34986 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
34987 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34988 : } else if ((8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT)) {
34989 : return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
34990 : }
34991 : }
34992 : break;
34993 : }
34994 : }
34995 : #endif
34996 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
34997 : if (unlikely(Py_SIZE(x) < 0)) {
34998 : goto raise_neg_overflow;
34999 : }
35000 : #else
35001 : {
35002 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35003 : if (unlikely(result < 0))
35004 : return (npy_int32) -1;
35005 : if (unlikely(result == 1))
35006 : goto raise_neg_overflow;
35007 : }
35008 : #endif
35009 : if ((sizeof(npy_int32) <= sizeof(unsigned long))) {
35010 : __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
35011 : #ifdef HAVE_LONG_LONG
35012 : } else if ((sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG))) {
35013 : __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35014 : #endif
35015 : }
35016 : } else {
35017 : #if CYTHON_USE_PYLONG_INTERNALS
35018 541 : if (__Pyx_PyLong_IsCompact(x)) {
35019 406 : __PYX_VERIFY_RETURN_INT(npy_int32, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
35020 : } else {
35021 135 : const digit* digits = __Pyx_PyLong_Digits(x);
35022 135 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35023 135 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
35024 : case -2:
35025 0 : if ((8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT)) {
35026 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35027 0 : __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35028 : } else if ((8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT)) {
35029 : return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
35030 : }
35031 : }
35032 : break;
35033 : case 2:
35034 135 : if ((8 * sizeof(npy_int32) > 1 * PyLong_SHIFT)) {
35035 135 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35036 135 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35037 : } else if ((8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT)) {
35038 : return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
35039 : }
35040 : }
35041 : break;
35042 : case -3:
35043 : if ((8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT)) {
35044 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35045 : __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35046 : } else if ((8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT)) {
35047 : return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
35048 : }
35049 : }
35050 : break;
35051 : case 3:
35052 : if ((8 * sizeof(npy_int32) > 2 * PyLong_SHIFT)) {
35053 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35054 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35055 : } else if ((8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT)) {
35056 : return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
35057 : }
35058 : }
35059 : break;
35060 : case -4:
35061 : if ((8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT)) {
35062 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35063 : __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35064 : } else if ((8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT)) {
35065 : return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
35066 : }
35067 : }
35068 : break;
35069 : case 4:
35070 : if ((8 * sizeof(npy_int32) > 3 * PyLong_SHIFT)) {
35071 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35072 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35073 : } else if ((8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT)) {
35074 : return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
35075 : }
35076 : }
35077 : break;
35078 : }
35079 : }
35080 : #endif
35081 0 : if ((sizeof(npy_int32) <= sizeof(long))) {
35082 0 : __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
35083 : #ifdef HAVE_LONG_LONG
35084 : } else if ((sizeof(npy_int32) <= sizeof(PY_LONG_LONG))) {
35085 : __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
35086 : #endif
35087 : }
35088 : }
35089 : {
35090 : npy_int32 val;
35091 : int ret = -1;
35092 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
35093 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
35094 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
35095 : if (unlikely(bytes_copied == -1)) {
35096 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
35097 : goto raise_overflow;
35098 : } else {
35099 : ret = 0;
35100 : }
35101 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
35102 : int one = 1; int is_little = (int)*(unsigned char *)&one;
35103 : unsigned char *bytes = (unsigned char *)&val;
35104 : ret = _PyLong_AsByteArray((PyLongObject *)x,
35105 : bytes, sizeof(val),
35106 : is_little, !is_unsigned);
35107 : #else
35108 : PyObject *v;
35109 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
35110 : int bits, remaining_bits, is_negative = 0;
35111 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
35112 : if (likely(PyLong_CheckExact(x))) {
35113 : v = __Pyx_NewRef(x);
35114 : } else {
35115 : v = PyNumber_Long(x);
35116 : if (unlikely(!v)) return (npy_int32) -1;
35117 : assert(PyLong_CheckExact(v));
35118 : }
35119 : {
35120 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
35121 : if (unlikely(result < 0)) {
35122 : Py_DECREF(v);
35123 : return (npy_int32) -1;
35124 : }
35125 : is_negative = result == 1;
35126 : }
35127 : if (is_unsigned && unlikely(is_negative)) {
35128 : Py_DECREF(v);
35129 : goto raise_neg_overflow;
35130 : } else if (is_negative) {
35131 : stepval = PyNumber_Invert(v);
35132 : Py_DECREF(v);
35133 : if (unlikely(!stepval))
35134 : return (npy_int32) -1;
35135 : } else {
35136 : stepval = v;
35137 : }
35138 : v = NULL;
35139 : val = (npy_int32) 0;
35140 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
35141 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
35142 : for (bits = 0; bits < (int) sizeof(npy_int32) * 8 - chunk_size; bits += chunk_size) {
35143 : PyObject *tmp, *digit;
35144 : long idigit;
35145 : digit = PyNumber_And(stepval, mask);
35146 : if (unlikely(!digit)) goto done;
35147 : idigit = PyLong_AsLong(digit);
35148 : Py_DECREF(digit);
35149 : if (unlikely(idigit < 0)) goto done;
35150 : val |= ((npy_int32) idigit) << bits;
35151 : tmp = PyNumber_Rshift(stepval, shift);
35152 : if (unlikely(!tmp)) goto done;
35153 : Py_DECREF(stepval); stepval = tmp;
35154 : }
35155 : Py_DECREF(shift); shift = NULL;
35156 : Py_DECREF(mask); mask = NULL;
35157 : {
35158 : long idigit = PyLong_AsLong(stepval);
35159 : if (unlikely(idigit < 0)) goto done;
35160 : remaining_bits = ((int) sizeof(npy_int32) * 8) - bits - (is_unsigned ? 0 : 1);
35161 : if (unlikely(idigit >= (1L << remaining_bits)))
35162 : goto raise_overflow;
35163 : val |= ((npy_int32) idigit) << bits;
35164 : }
35165 : if (!is_unsigned) {
35166 : if (unlikely(val & (((npy_int32) 1) << (sizeof(npy_int32) * 8 - 1))))
35167 : goto raise_overflow;
35168 : if (is_negative)
35169 : val = ~val;
35170 : }
35171 : ret = 0;
35172 : done:
35173 : Py_XDECREF(shift);
35174 : Py_XDECREF(mask);
35175 : Py_XDECREF(stepval);
35176 : #endif
35177 : if (unlikely(ret))
35178 : return (npy_int32) -1;
35179 : return val;
35180 : }
35181 0 : raise_overflow:
35182 0 : PyErr_SetString(PyExc_OverflowError,
35183 : "value too large to convert to npy_int32");
35184 0 : return (npy_int32) -1;
35185 : raise_neg_overflow:
35186 : PyErr_SetString(PyExc_OverflowError,
35187 : "can't convert negative value to npy_int32");
35188 : return (npy_int32) -1;
35189 : }
35190 :
35191 : /* CIntToPy */
35192 1085 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
35193 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35194 : #pragma GCC diagnostic push
35195 : #pragma GCC diagnostic ignored "-Wconversion"
35196 : #endif
35197 1085 : const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
35198 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35199 : #pragma GCC diagnostic pop
35200 : #endif
35201 1085 : const int is_unsigned = neg_one > const_zero;
35202 1085 : if (is_unsigned) {
35203 : if (sizeof(npy_int32) < sizeof(long)) {
35204 : return PyInt_FromLong((long) value);
35205 : } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
35206 : return PyLong_FromUnsignedLong((unsigned long) value);
35207 : #ifdef HAVE_LONG_LONG
35208 : } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
35209 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35210 : #endif
35211 : }
35212 : } else {
35213 1085 : if (sizeof(npy_int32) <= sizeof(long)) {
35214 1085 : return PyInt_FromLong((long) value);
35215 : #ifdef HAVE_LONG_LONG
35216 : } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
35217 : return PyLong_FromLongLong((PY_LONG_LONG) value);
35218 : #endif
35219 : }
35220 : }
35221 : {
35222 : unsigned char *bytes = (unsigned char *)&value;
35223 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
35224 : if (is_unsigned) {
35225 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
35226 : } else {
35227 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
35228 : }
35229 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
35230 : int one = 1; int little = (int)*(unsigned char *)&one;
35231 : return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
35232 : little, !is_unsigned);
35233 : #else
35234 : int one = 1; int little = (int)*(unsigned char *)&one;
35235 : PyObject *from_bytes, *result = NULL;
35236 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
35237 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
35238 : if (!from_bytes) return NULL;
35239 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_int32));
35240 : if (!py_bytes) goto limited_bad;
35241 : order_str = PyUnicode_FromString(little ? "little" : "big");
35242 : if (!order_str) goto limited_bad;
35243 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
35244 : if (!arg_tuple) goto limited_bad;
35245 : if (!is_unsigned) {
35246 : kwds = PyDict_New();
35247 : if (!kwds) goto limited_bad;
35248 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
35249 : }
35250 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
35251 : limited_bad:
35252 : Py_XDECREF(kwds);
35253 : Py_XDECREF(arg_tuple);
35254 : Py_XDECREF(order_str);
35255 : Py_XDECREF(py_bytes);
35256 : Py_XDECREF(from_bytes);
35257 : return result;
35258 : #endif
35259 : }
35260 : }
35261 :
35262 : /* CIntToPy */
35263 405 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
35264 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35265 : #pragma GCC diagnostic push
35266 : #pragma GCC diagnostic ignored "-Wconversion"
35267 : #endif
35268 405 : const long neg_one = (long) -1, const_zero = (long) 0;
35269 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35270 : #pragma GCC diagnostic pop
35271 : #endif
35272 405 : const int is_unsigned = neg_one > const_zero;
35273 405 : if (is_unsigned) {
35274 : if (sizeof(long) < sizeof(long)) {
35275 : return PyInt_FromLong((long) value);
35276 : } else if (sizeof(long) <= sizeof(unsigned long)) {
35277 : return PyLong_FromUnsignedLong((unsigned long) value);
35278 : #ifdef HAVE_LONG_LONG
35279 : } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
35280 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35281 : #endif
35282 : }
35283 : } else {
35284 405 : if (sizeof(long) <= sizeof(long)) {
35285 405 : return PyInt_FromLong((long) value);
35286 : #ifdef HAVE_LONG_LONG
35287 : } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
35288 : return PyLong_FromLongLong((PY_LONG_LONG) value);
35289 : #endif
35290 : }
35291 : }
35292 : {
35293 : unsigned char *bytes = (unsigned char *)&value;
35294 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
35295 : if (is_unsigned) {
35296 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
35297 : } else {
35298 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
35299 : }
35300 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
35301 : int one = 1; int little = (int)*(unsigned char *)&one;
35302 : return _PyLong_FromByteArray(bytes, sizeof(long),
35303 : little, !is_unsigned);
35304 : #else
35305 : int one = 1; int little = (int)*(unsigned char *)&one;
35306 : PyObject *from_bytes, *result = NULL;
35307 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
35308 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
35309 : if (!from_bytes) return NULL;
35310 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
35311 : if (!py_bytes) goto limited_bad;
35312 : order_str = PyUnicode_FromString(little ? "little" : "big");
35313 : if (!order_str) goto limited_bad;
35314 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
35315 : if (!arg_tuple) goto limited_bad;
35316 : if (!is_unsigned) {
35317 : kwds = PyDict_New();
35318 : if (!kwds) goto limited_bad;
35319 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
35320 : }
35321 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
35322 : limited_bad:
35323 : Py_XDECREF(kwds);
35324 : Py_XDECREF(arg_tuple);
35325 : Py_XDECREF(order_str);
35326 : Py_XDECREF(py_bytes);
35327 : Py_XDECREF(from_bytes);
35328 : return result;
35329 : #endif
35330 : }
35331 : }
35332 :
35333 : /* CIntFromPy */
35334 0 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
35335 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35336 : #pragma GCC diagnostic push
35337 : #pragma GCC diagnostic ignored "-Wconversion"
35338 : #endif
35339 0 : const long neg_one = (long) -1, const_zero = (long) 0;
35340 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35341 : #pragma GCC diagnostic pop
35342 : #endif
35343 0 : const int is_unsigned = neg_one > const_zero;
35344 : #if PY_MAJOR_VERSION < 3
35345 : if (likely(PyInt_Check(x))) {
35346 : if ((sizeof(long) < sizeof(long))) {
35347 : __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
35348 : } else {
35349 : long val = PyInt_AS_LONG(x);
35350 : if (is_unsigned && unlikely(val < 0)) {
35351 : goto raise_neg_overflow;
35352 : }
35353 : return (long) val;
35354 : }
35355 : }
35356 : #endif
35357 0 : if (unlikely(!PyLong_Check(x))) {
35358 0 : long val;
35359 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35360 0 : if (!tmp) return (long) -1;
35361 0 : val = __Pyx_PyInt_As_long(tmp);
35362 0 : Py_DECREF(tmp);
35363 0 : return val;
35364 : }
35365 0 : if (is_unsigned) {
35366 : #if CYTHON_USE_PYLONG_INTERNALS
35367 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
35368 : goto raise_neg_overflow;
35369 : } else if (__Pyx_PyLong_IsCompact(x)) {
35370 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
35371 : } else {
35372 : const digit* digits = __Pyx_PyLong_Digits(x);
35373 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35374 : switch (__Pyx_PyLong_DigitCount(x)) {
35375 : case 2:
35376 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
35377 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35378 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35379 : } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
35380 : return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
35381 : }
35382 : }
35383 : break;
35384 : case 3:
35385 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
35386 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35387 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35388 : } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
35389 : return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
35390 : }
35391 : }
35392 : break;
35393 : case 4:
35394 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
35395 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35396 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35397 : } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
35398 : return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
35399 : }
35400 : }
35401 : break;
35402 : }
35403 : }
35404 : #endif
35405 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
35406 : if (unlikely(Py_SIZE(x) < 0)) {
35407 : goto raise_neg_overflow;
35408 : }
35409 : #else
35410 : {
35411 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35412 : if (unlikely(result < 0))
35413 : return (long) -1;
35414 : if (unlikely(result == 1))
35415 : goto raise_neg_overflow;
35416 : }
35417 : #endif
35418 : if ((sizeof(long) <= sizeof(unsigned long))) {
35419 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
35420 : #ifdef HAVE_LONG_LONG
35421 : } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
35422 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35423 : #endif
35424 : }
35425 : } else {
35426 : #if CYTHON_USE_PYLONG_INTERNALS
35427 0 : if (__Pyx_PyLong_IsCompact(x)) {
35428 0 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
35429 : } else {
35430 0 : const digit* digits = __Pyx_PyLong_Digits(x);
35431 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35432 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
35433 : case -2:
35434 0 : if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
35435 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35436 0 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35437 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
35438 : return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35439 : }
35440 : }
35441 : break;
35442 : case 2:
35443 0 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
35444 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35445 0 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35446 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
35447 : return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35448 : }
35449 : }
35450 : break;
35451 : case -3:
35452 : if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
35453 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35454 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35455 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
35456 : return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35457 : }
35458 : }
35459 : break;
35460 : case 3:
35461 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
35462 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35463 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35464 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
35465 : return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35466 : }
35467 : }
35468 : break;
35469 : case -4:
35470 : if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
35471 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35472 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35473 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
35474 : return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35475 : }
35476 : }
35477 : break;
35478 : case 4:
35479 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
35480 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35481 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35482 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
35483 : return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35484 : }
35485 : }
35486 : break;
35487 : }
35488 : }
35489 : #endif
35490 0 : if ((sizeof(long) <= sizeof(long))) {
35491 0 : __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
35492 : #ifdef HAVE_LONG_LONG
35493 : } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
35494 : __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
35495 : #endif
35496 : }
35497 : }
35498 : {
35499 : long val;
35500 : int ret = -1;
35501 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
35502 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
35503 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
35504 : if (unlikely(bytes_copied == -1)) {
35505 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
35506 : goto raise_overflow;
35507 : } else {
35508 : ret = 0;
35509 : }
35510 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
35511 : int one = 1; int is_little = (int)*(unsigned char *)&one;
35512 : unsigned char *bytes = (unsigned char *)&val;
35513 : ret = _PyLong_AsByteArray((PyLongObject *)x,
35514 : bytes, sizeof(val),
35515 : is_little, !is_unsigned);
35516 : #else
35517 : PyObject *v;
35518 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
35519 : int bits, remaining_bits, is_negative = 0;
35520 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
35521 : if (likely(PyLong_CheckExact(x))) {
35522 : v = __Pyx_NewRef(x);
35523 : } else {
35524 : v = PyNumber_Long(x);
35525 : if (unlikely(!v)) return (long) -1;
35526 : assert(PyLong_CheckExact(v));
35527 : }
35528 : {
35529 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
35530 : if (unlikely(result < 0)) {
35531 : Py_DECREF(v);
35532 : return (long) -1;
35533 : }
35534 : is_negative = result == 1;
35535 : }
35536 : if (is_unsigned && unlikely(is_negative)) {
35537 : Py_DECREF(v);
35538 : goto raise_neg_overflow;
35539 : } else if (is_negative) {
35540 : stepval = PyNumber_Invert(v);
35541 : Py_DECREF(v);
35542 : if (unlikely(!stepval))
35543 : return (long) -1;
35544 : } else {
35545 : stepval = v;
35546 : }
35547 : v = NULL;
35548 : val = (long) 0;
35549 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
35550 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
35551 : for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
35552 : PyObject *tmp, *digit;
35553 : long idigit;
35554 : digit = PyNumber_And(stepval, mask);
35555 : if (unlikely(!digit)) goto done;
35556 : idigit = PyLong_AsLong(digit);
35557 : Py_DECREF(digit);
35558 : if (unlikely(idigit < 0)) goto done;
35559 : val |= ((long) idigit) << bits;
35560 : tmp = PyNumber_Rshift(stepval, shift);
35561 : if (unlikely(!tmp)) goto done;
35562 : Py_DECREF(stepval); stepval = tmp;
35563 : }
35564 : Py_DECREF(shift); shift = NULL;
35565 : Py_DECREF(mask); mask = NULL;
35566 : {
35567 : long idigit = PyLong_AsLong(stepval);
35568 : if (unlikely(idigit < 0)) goto done;
35569 : remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
35570 : if (unlikely(idigit >= (1L << remaining_bits)))
35571 : goto raise_overflow;
35572 : val |= ((long) idigit) << bits;
35573 : }
35574 : if (!is_unsigned) {
35575 : if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
35576 : goto raise_overflow;
35577 : if (is_negative)
35578 : val = ~val;
35579 : }
35580 : ret = 0;
35581 : done:
35582 : Py_XDECREF(shift);
35583 : Py_XDECREF(mask);
35584 : Py_XDECREF(stepval);
35585 : #endif
35586 : if (unlikely(ret))
35587 : return (long) -1;
35588 : return val;
35589 : }
35590 : raise_overflow:
35591 : PyErr_SetString(PyExc_OverflowError,
35592 : "value too large to convert to long");
35593 : return (long) -1;
35594 : raise_neg_overflow:
35595 : PyErr_SetString(PyExc_OverflowError,
35596 : "can't convert negative value to long");
35597 : return (long) -1;
35598 : }
35599 :
35600 : /* CIntFromPy */
35601 2302 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
35602 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35603 : #pragma GCC diagnostic push
35604 : #pragma GCC diagnostic ignored "-Wconversion"
35605 : #endif
35606 2302 : const int neg_one = (int) -1, const_zero = (int) 0;
35607 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35608 : #pragma GCC diagnostic pop
35609 : #endif
35610 2302 : const int is_unsigned = neg_one > const_zero;
35611 : #if PY_MAJOR_VERSION < 3
35612 : if (likely(PyInt_Check(x))) {
35613 : if ((sizeof(int) < sizeof(long))) {
35614 : __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
35615 : } else {
35616 : long val = PyInt_AS_LONG(x);
35617 : if (is_unsigned && unlikely(val < 0)) {
35618 : goto raise_neg_overflow;
35619 : }
35620 : return (int) val;
35621 : }
35622 : }
35623 : #endif
35624 2302 : if (unlikely(!PyLong_Check(x))) {
35625 0 : int val;
35626 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35627 0 : if (!tmp) return (int) -1;
35628 0 : val = __Pyx_PyInt_As_int(tmp);
35629 0 : Py_DECREF(tmp);
35630 0 : return val;
35631 : }
35632 2302 : if (is_unsigned) {
35633 : #if CYTHON_USE_PYLONG_INTERNALS
35634 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
35635 : goto raise_neg_overflow;
35636 : } else if (__Pyx_PyLong_IsCompact(x)) {
35637 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
35638 : } else {
35639 : const digit* digits = __Pyx_PyLong_Digits(x);
35640 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35641 : switch (__Pyx_PyLong_DigitCount(x)) {
35642 : case 2:
35643 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
35644 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35645 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35646 : } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
35647 : return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35648 : }
35649 : }
35650 : break;
35651 : case 3:
35652 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
35653 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35654 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35655 : } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
35656 : return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35657 : }
35658 : }
35659 : break;
35660 : case 4:
35661 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
35662 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35663 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35664 : } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
35665 : return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35666 : }
35667 : }
35668 : break;
35669 : }
35670 : }
35671 : #endif
35672 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
35673 : if (unlikely(Py_SIZE(x) < 0)) {
35674 : goto raise_neg_overflow;
35675 : }
35676 : #else
35677 : {
35678 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35679 : if (unlikely(result < 0))
35680 : return (int) -1;
35681 : if (unlikely(result == 1))
35682 : goto raise_neg_overflow;
35683 : }
35684 : #endif
35685 : if ((sizeof(int) <= sizeof(unsigned long))) {
35686 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
35687 : #ifdef HAVE_LONG_LONG
35688 : } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
35689 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35690 : #endif
35691 : }
35692 : } else {
35693 : #if CYTHON_USE_PYLONG_INTERNALS
35694 2302 : if (__Pyx_PyLong_IsCompact(x)) {
35695 2302 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
35696 : } else {
35697 0 : const digit* digits = __Pyx_PyLong_Digits(x);
35698 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35699 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
35700 : case -2:
35701 0 : if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
35702 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35703 0 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35704 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
35705 : return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35706 : }
35707 : }
35708 : break;
35709 : case 2:
35710 0 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
35711 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35712 0 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35713 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
35714 : return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35715 : }
35716 : }
35717 : break;
35718 : case -3:
35719 : if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
35720 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35721 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35722 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
35723 : return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35724 : }
35725 : }
35726 : break;
35727 : case 3:
35728 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
35729 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35730 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35731 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
35732 : return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35733 : }
35734 : }
35735 : break;
35736 : case -4:
35737 : if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
35738 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35739 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35740 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
35741 : return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35742 : }
35743 : }
35744 : break;
35745 : case 4:
35746 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
35747 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35748 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35749 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
35750 : return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35751 : }
35752 : }
35753 : break;
35754 : }
35755 : }
35756 : #endif
35757 0 : if ((sizeof(int) <= sizeof(long))) {
35758 0 : __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
35759 : #ifdef HAVE_LONG_LONG
35760 : } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
35761 : __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
35762 : #endif
35763 : }
35764 : }
35765 : {
35766 : int val;
35767 : int ret = -1;
35768 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
35769 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
35770 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
35771 : if (unlikely(bytes_copied == -1)) {
35772 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
35773 : goto raise_overflow;
35774 : } else {
35775 : ret = 0;
35776 : }
35777 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
35778 : int one = 1; int is_little = (int)*(unsigned char *)&one;
35779 : unsigned char *bytes = (unsigned char *)&val;
35780 : ret = _PyLong_AsByteArray((PyLongObject *)x,
35781 : bytes, sizeof(val),
35782 : is_little, !is_unsigned);
35783 : #else
35784 : PyObject *v;
35785 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
35786 : int bits, remaining_bits, is_negative = 0;
35787 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
35788 : if (likely(PyLong_CheckExact(x))) {
35789 : v = __Pyx_NewRef(x);
35790 : } else {
35791 : v = PyNumber_Long(x);
35792 : if (unlikely(!v)) return (int) -1;
35793 : assert(PyLong_CheckExact(v));
35794 : }
35795 : {
35796 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
35797 : if (unlikely(result < 0)) {
35798 : Py_DECREF(v);
35799 : return (int) -1;
35800 : }
35801 : is_negative = result == 1;
35802 : }
35803 : if (is_unsigned && unlikely(is_negative)) {
35804 : Py_DECREF(v);
35805 : goto raise_neg_overflow;
35806 : } else if (is_negative) {
35807 : stepval = PyNumber_Invert(v);
35808 : Py_DECREF(v);
35809 : if (unlikely(!stepval))
35810 : return (int) -1;
35811 : } else {
35812 : stepval = v;
35813 : }
35814 : v = NULL;
35815 : val = (int) 0;
35816 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
35817 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
35818 : for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
35819 : PyObject *tmp, *digit;
35820 : long idigit;
35821 : digit = PyNumber_And(stepval, mask);
35822 : if (unlikely(!digit)) goto done;
35823 : idigit = PyLong_AsLong(digit);
35824 : Py_DECREF(digit);
35825 : if (unlikely(idigit < 0)) goto done;
35826 : val |= ((int) idigit) << bits;
35827 : tmp = PyNumber_Rshift(stepval, shift);
35828 : if (unlikely(!tmp)) goto done;
35829 : Py_DECREF(stepval); stepval = tmp;
35830 : }
35831 : Py_DECREF(shift); shift = NULL;
35832 : Py_DECREF(mask); mask = NULL;
35833 : {
35834 : long idigit = PyLong_AsLong(stepval);
35835 : if (unlikely(idigit < 0)) goto done;
35836 : remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
35837 : if (unlikely(idigit >= (1L << remaining_bits)))
35838 : goto raise_overflow;
35839 : val |= ((int) idigit) << bits;
35840 : }
35841 : if (!is_unsigned) {
35842 : if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
35843 : goto raise_overflow;
35844 : if (is_negative)
35845 : val = ~val;
35846 : }
35847 : ret = 0;
35848 : done:
35849 : Py_XDECREF(shift);
35850 : Py_XDECREF(mask);
35851 : Py_XDECREF(stepval);
35852 : #endif
35853 : if (unlikely(ret))
35854 : return (int) -1;
35855 : return val;
35856 : }
35857 0 : raise_overflow:
35858 0 : PyErr_SetString(PyExc_OverflowError,
35859 : "value too large to convert to int");
35860 0 : return (int) -1;
35861 : raise_neg_overflow:
35862 : PyErr_SetString(PyExc_OverflowError,
35863 : "can't convert negative value to int");
35864 : return (int) -1;
35865 : }
35866 :
35867 : /* CIntToPy */
35868 1964 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
35869 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35870 : #pragma GCC diagnostic push
35871 : #pragma GCC diagnostic ignored "-Wconversion"
35872 : #endif
35873 1964 : const int neg_one = (int) -1, const_zero = (int) 0;
35874 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35875 : #pragma GCC diagnostic pop
35876 : #endif
35877 1964 : const int is_unsigned = neg_one > const_zero;
35878 1964 : if (is_unsigned) {
35879 : if (sizeof(int) < sizeof(long)) {
35880 : return PyInt_FromLong((long) value);
35881 : } else if (sizeof(int) <= sizeof(unsigned long)) {
35882 : return PyLong_FromUnsignedLong((unsigned long) value);
35883 : #ifdef HAVE_LONG_LONG
35884 : } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
35885 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35886 : #endif
35887 : }
35888 : } else {
35889 1964 : if (sizeof(int) <= sizeof(long)) {
35890 1964 : return PyInt_FromLong((long) value);
35891 : #ifdef HAVE_LONG_LONG
35892 : } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
35893 : return PyLong_FromLongLong((PY_LONG_LONG) value);
35894 : #endif
35895 : }
35896 : }
35897 : {
35898 : unsigned char *bytes = (unsigned char *)&value;
35899 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
35900 : if (is_unsigned) {
35901 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
35902 : } else {
35903 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
35904 : }
35905 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
35906 : int one = 1; int little = (int)*(unsigned char *)&one;
35907 : return _PyLong_FromByteArray(bytes, sizeof(int),
35908 : little, !is_unsigned);
35909 : #else
35910 : int one = 1; int little = (int)*(unsigned char *)&one;
35911 : PyObject *from_bytes, *result = NULL;
35912 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
35913 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
35914 : if (!from_bytes) return NULL;
35915 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
35916 : if (!py_bytes) goto limited_bad;
35917 : order_str = PyUnicode_FromString(little ? "little" : "big");
35918 : if (!order_str) goto limited_bad;
35919 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
35920 : if (!arg_tuple) goto limited_bad;
35921 : if (!is_unsigned) {
35922 : kwds = PyDict_New();
35923 : if (!kwds) goto limited_bad;
35924 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
35925 : }
35926 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
35927 : limited_bad:
35928 : Py_XDECREF(kwds);
35929 : Py_XDECREF(arg_tuple);
35930 : Py_XDECREF(order_str);
35931 : Py_XDECREF(py_bytes);
35932 : Py_XDECREF(from_bytes);
35933 : return result;
35934 : #endif
35935 : }
35936 : }
35937 :
35938 : /* CIntFromPy */
35939 : static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
35940 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35941 : #pragma GCC diagnostic push
35942 : #pragma GCC diagnostic ignored "-Wconversion"
35943 : #endif
35944 : const char neg_one = (char) -1, const_zero = (char) 0;
35945 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35946 : #pragma GCC diagnostic pop
35947 : #endif
35948 : const int is_unsigned = neg_one > const_zero;
35949 : #if PY_MAJOR_VERSION < 3
35950 : if (likely(PyInt_Check(x))) {
35951 : if ((sizeof(char) < sizeof(long))) {
35952 : __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
35953 : } else {
35954 : long val = PyInt_AS_LONG(x);
35955 : if (is_unsigned && unlikely(val < 0)) {
35956 : goto raise_neg_overflow;
35957 : }
35958 : return (char) val;
35959 : }
35960 : }
35961 : #endif
35962 : if (unlikely(!PyLong_Check(x))) {
35963 : char val;
35964 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35965 : if (!tmp) return (char) -1;
35966 : val = __Pyx_PyInt_As_char(tmp);
35967 : Py_DECREF(tmp);
35968 : return val;
35969 : }
35970 : if (is_unsigned) {
35971 : #if CYTHON_USE_PYLONG_INTERNALS
35972 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
35973 : goto raise_neg_overflow;
35974 : } else if (__Pyx_PyLong_IsCompact(x)) {
35975 : __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
35976 : } else {
35977 : const digit* digits = __Pyx_PyLong_Digits(x);
35978 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35979 : switch (__Pyx_PyLong_DigitCount(x)) {
35980 : case 2:
35981 : if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
35982 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35983 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35984 : } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) {
35985 : return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
35986 : }
35987 : }
35988 : break;
35989 : case 3:
35990 : if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
35991 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35992 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35993 : } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) {
35994 : return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
35995 : }
35996 : }
35997 : break;
35998 : case 4:
35999 : if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
36000 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36001 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36002 : } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) {
36003 : return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
36004 : }
36005 : }
36006 : break;
36007 : }
36008 : }
36009 : #endif
36010 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
36011 : if (unlikely(Py_SIZE(x) < 0)) {
36012 : goto raise_neg_overflow;
36013 : }
36014 : #else
36015 : {
36016 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
36017 : if (unlikely(result < 0))
36018 : return (char) -1;
36019 : if (unlikely(result == 1))
36020 : goto raise_neg_overflow;
36021 : }
36022 : #endif
36023 : if ((sizeof(char) <= sizeof(unsigned long))) {
36024 : __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
36025 : #ifdef HAVE_LONG_LONG
36026 : } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
36027 : __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
36028 : #endif
36029 : }
36030 : } else {
36031 : #if CYTHON_USE_PYLONG_INTERNALS
36032 : if (__Pyx_PyLong_IsCompact(x)) {
36033 : __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
36034 : } else {
36035 : const digit* digits = __Pyx_PyLong_Digits(x);
36036 : assert(__Pyx_PyLong_DigitCount(x) > 1);
36037 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
36038 : case -2:
36039 : if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) {
36040 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36041 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36042 : } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
36043 : return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36044 : }
36045 : }
36046 : break;
36047 : case 2:
36048 : if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
36049 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36050 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36051 : } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
36052 : return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36053 : }
36054 : }
36055 : break;
36056 : case -3:
36057 : if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
36058 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36059 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36060 : } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
36061 : return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36062 : }
36063 : }
36064 : break;
36065 : case 3:
36066 : if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
36067 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36068 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36069 : } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
36070 : return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36071 : }
36072 : }
36073 : break;
36074 : case -4:
36075 : if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
36076 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36077 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36078 : } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
36079 : return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36080 : }
36081 : }
36082 : break;
36083 : case 4:
36084 : if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
36085 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36086 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36087 : } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
36088 : return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36089 : }
36090 : }
36091 : break;
36092 : }
36093 : }
36094 : #endif
36095 : if ((sizeof(char) <= sizeof(long))) {
36096 : __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
36097 : #ifdef HAVE_LONG_LONG
36098 : } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
36099 : __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
36100 : #endif
36101 : }
36102 : }
36103 : {
36104 : char val;
36105 : int ret = -1;
36106 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
36107 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
36108 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
36109 : if (unlikely(bytes_copied == -1)) {
36110 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
36111 : goto raise_overflow;
36112 : } else {
36113 : ret = 0;
36114 : }
36115 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
36116 : int one = 1; int is_little = (int)*(unsigned char *)&one;
36117 : unsigned char *bytes = (unsigned char *)&val;
36118 : ret = _PyLong_AsByteArray((PyLongObject *)x,
36119 : bytes, sizeof(val),
36120 : is_little, !is_unsigned);
36121 : #else
36122 : PyObject *v;
36123 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
36124 : int bits, remaining_bits, is_negative = 0;
36125 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
36126 : if (likely(PyLong_CheckExact(x))) {
36127 : v = __Pyx_NewRef(x);
36128 : } else {
36129 : v = PyNumber_Long(x);
36130 : if (unlikely(!v)) return (char) -1;
36131 : assert(PyLong_CheckExact(v));
36132 : }
36133 : {
36134 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
36135 : if (unlikely(result < 0)) {
36136 : Py_DECREF(v);
36137 : return (char) -1;
36138 : }
36139 : is_negative = result == 1;
36140 : }
36141 : if (is_unsigned && unlikely(is_negative)) {
36142 : Py_DECREF(v);
36143 : goto raise_neg_overflow;
36144 : } else if (is_negative) {
36145 : stepval = PyNumber_Invert(v);
36146 : Py_DECREF(v);
36147 : if (unlikely(!stepval))
36148 : return (char) -1;
36149 : } else {
36150 : stepval = v;
36151 : }
36152 : v = NULL;
36153 : val = (char) 0;
36154 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
36155 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
36156 : for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
36157 : PyObject *tmp, *digit;
36158 : long idigit;
36159 : digit = PyNumber_And(stepval, mask);
36160 : if (unlikely(!digit)) goto done;
36161 : idigit = PyLong_AsLong(digit);
36162 : Py_DECREF(digit);
36163 : if (unlikely(idigit < 0)) goto done;
36164 : val |= ((char) idigit) << bits;
36165 : tmp = PyNumber_Rshift(stepval, shift);
36166 : if (unlikely(!tmp)) goto done;
36167 : Py_DECREF(stepval); stepval = tmp;
36168 : }
36169 : Py_DECREF(shift); shift = NULL;
36170 : Py_DECREF(mask); mask = NULL;
36171 : {
36172 : long idigit = PyLong_AsLong(stepval);
36173 : if (unlikely(idigit < 0)) goto done;
36174 : remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
36175 : if (unlikely(idigit >= (1L << remaining_bits)))
36176 : goto raise_overflow;
36177 : val |= ((char) idigit) << bits;
36178 : }
36179 : if (!is_unsigned) {
36180 : if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
36181 : goto raise_overflow;
36182 : if (is_negative)
36183 : val = ~val;
36184 : }
36185 : ret = 0;
36186 : done:
36187 : Py_XDECREF(shift);
36188 : Py_XDECREF(mask);
36189 : Py_XDECREF(stepval);
36190 : #endif
36191 : if (unlikely(ret))
36192 : return (char) -1;
36193 : return val;
36194 : }
36195 : raise_overflow:
36196 : PyErr_SetString(PyExc_OverflowError,
36197 : "value too large to convert to char");
36198 : return (char) -1;
36199 : raise_neg_overflow:
36200 : PyErr_SetString(PyExc_OverflowError,
36201 : "can't convert negative value to char");
36202 : return (char) -1;
36203 : }
36204 :
36205 : /* FormatTypeName */
36206 : #if CYTHON_COMPILING_IN_LIMITED_API
36207 : static __Pyx_TypeName
36208 : __Pyx_PyType_GetName(PyTypeObject* tp)
36209 : {
36210 : PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
36211 : __pyx_n_s_name_2);
36212 : if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
36213 : PyErr_Clear();
36214 : Py_XDECREF(name);
36215 : name = __Pyx_NewRef(__pyx_n_s__32);
36216 : }
36217 : return name;
36218 : }
36219 : #endif
36220 :
36221 : /* CheckBinaryVersion */
36222 1 : static unsigned long __Pyx_get_runtime_version(void) {
36223 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
36224 1 : return Py_Version & ~0xFFUL;
36225 : #else
36226 : const char* rt_version = Py_GetVersion();
36227 : unsigned long version = 0;
36228 : unsigned long factor = 0x01000000UL;
36229 : unsigned int digit = 0;
36230 : int i = 0;
36231 : while (factor) {
36232 : while ('0' <= rt_version[i] && rt_version[i] <= '9') {
36233 : digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
36234 : ++i;
36235 : }
36236 : version += factor * digit;
36237 : if (rt_version[i] != '.')
36238 : break;
36239 : digit = 0;
36240 : factor >>= 8;
36241 : ++i;
36242 : }
36243 : return version;
36244 : #endif
36245 : }
36246 1 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
36247 1 : const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
36248 1 : if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
36249 : return 0;
36250 0 : if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
36251 : return 1;
36252 : {
36253 0 : char message[200];
36254 0 : PyOS_snprintf(message, sizeof(message),
36255 : "compile time Python version %d.%d "
36256 : "of module '%.100s' "
36257 : "%s "
36258 : "runtime version %d.%d",
36259 0 : (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
36260 : __Pyx_MODULE_NAME,
36261 : (allow_newer) ? "was newer than" : "does not match",
36262 0 : (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
36263 : );
36264 0 : return PyErr_WarnEx(NULL, message, 1);
36265 : }
36266 : }
36267 :
36268 : /* InitStrings */
36269 : #if PY_MAJOR_VERSION >= 3
36270 188 : static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
36271 188 : if (t.is_unicode | t.is_str) {
36272 187 : if (t.intern) {
36273 133 : *str = PyUnicode_InternFromString(t.s);
36274 54 : } else if (t.encoding) {
36275 0 : *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
36276 : } else {
36277 54 : *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
36278 : }
36279 : } else {
36280 1 : *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
36281 : }
36282 188 : if (!*str)
36283 : return -1;
36284 188 : if (PyObject_Hash(*str) == -1)
36285 : return -1;
36286 : return 0;
36287 : }
36288 : #endif
36289 1 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
36290 189 : while (t->p) {
36291 : #if PY_MAJOR_VERSION >= 3
36292 188 : __Pyx_InitString(*t, t->p);
36293 : #else
36294 : if (t->is_unicode) {
36295 : *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
36296 : } else if (t->intern) {
36297 : *t->p = PyString_InternFromString(t->s);
36298 : } else {
36299 : *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
36300 : }
36301 : if (!*t->p)
36302 : return -1;
36303 : if (PyObject_Hash(*t->p) == -1)
36304 : return -1;
36305 : #endif
36306 188 : ++t;
36307 : }
36308 1 : return 0;
36309 : }
36310 :
36311 : #include <string.h>
36312 0 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
36313 0 : size_t len = strlen(s);
36314 0 : if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
36315 : PyErr_SetString(PyExc_OverflowError, "byte string is too long");
36316 : return -1;
36317 : }
36318 : return (Py_ssize_t) len;
36319 : }
36320 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
36321 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
36322 : if (unlikely(len < 0)) return NULL;
36323 : return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
36324 : }
36325 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
36326 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
36327 : if (unlikely(len < 0)) return NULL;
36328 : return PyByteArray_FromStringAndSize(c_str, len);
36329 : }
36330 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
36331 : Py_ssize_t ignore;
36332 : return __Pyx_PyObject_AsStringAndSize(o, &ignore);
36333 : }
36334 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
36335 : #if !CYTHON_PEP393_ENABLED
36336 : static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36337 : char* defenc_c;
36338 : PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
36339 : if (!defenc) return NULL;
36340 : defenc_c = PyBytes_AS_STRING(defenc);
36341 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36342 : {
36343 : char* end = defenc_c + PyBytes_GET_SIZE(defenc);
36344 : char* c;
36345 : for (c = defenc_c; c < end; c++) {
36346 : if ((unsigned char) (*c) >= 128) {
36347 : PyUnicode_AsASCIIString(o);
36348 : return NULL;
36349 : }
36350 : }
36351 : }
36352 : #endif
36353 : *length = PyBytes_GET_SIZE(defenc);
36354 : return defenc_c;
36355 : }
36356 : #else
36357 : static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36358 : if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
36359 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36360 : if (likely(PyUnicode_IS_ASCII(o))) {
36361 : *length = PyUnicode_GET_LENGTH(o);
36362 : return PyUnicode_AsUTF8(o);
36363 : } else {
36364 : PyUnicode_AsASCIIString(o);
36365 : return NULL;
36366 : }
36367 : #else
36368 : return PyUnicode_AsUTF8AndSize(o, length);
36369 : #endif
36370 : }
36371 : #endif
36372 : #endif
36373 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36374 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
36375 : if (
36376 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36377 : __Pyx_sys_getdefaultencoding_not_ascii &&
36378 : #endif
36379 : PyUnicode_Check(o)) {
36380 : return __Pyx_PyUnicode_AsStringAndSize(o, length);
36381 : } else
36382 : #endif
36383 : #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
36384 : if (PyByteArray_Check(o)) {
36385 : *length = PyByteArray_GET_SIZE(o);
36386 : return PyByteArray_AS_STRING(o);
36387 : } else
36388 : #endif
36389 : {
36390 : char* result;
36391 : int r = PyBytes_AsStringAndSize(o, &result, length);
36392 : if (unlikely(r < 0)) {
36393 : return NULL;
36394 : } else {
36395 : return result;
36396 : }
36397 : }
36398 : }
36399 3108 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
36400 3108 : int is_true = x == Py_True;
36401 3108 : if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
36402 223 : else return PyObject_IsTrue(x);
36403 : }
36404 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
36405 : int retval;
36406 : if (unlikely(!x)) return -1;
36407 : retval = __Pyx_PyObject_IsTrue(x);
36408 : Py_DECREF(x);
36409 : return retval;
36410 : }
36411 0 : static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
36412 0 : __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
36413 : #if PY_MAJOR_VERSION >= 3
36414 0 : if (PyLong_Check(result)) {
36415 0 : if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
36416 : "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
36417 : "The ability to return an instance of a strict subclass of int is deprecated, "
36418 : "and may be removed in a future version of Python.",
36419 : result_type_name)) {
36420 0 : __Pyx_DECREF_TypeName(result_type_name);
36421 0 : Py_DECREF(result);
36422 0 : return NULL;
36423 : }
36424 : __Pyx_DECREF_TypeName(result_type_name);
36425 : return result;
36426 : }
36427 : #endif
36428 0 : PyErr_Format(PyExc_TypeError,
36429 : "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
36430 : type_name, type_name, result_type_name);
36431 0 : __Pyx_DECREF_TypeName(result_type_name);
36432 0 : Py_DECREF(result);
36433 : return NULL;
36434 : }
36435 0 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
36436 : #if CYTHON_USE_TYPE_SLOTS
36437 0 : PyNumberMethods *m;
36438 : #endif
36439 0 : const char *name = NULL;
36440 0 : PyObject *res = NULL;
36441 : #if PY_MAJOR_VERSION < 3
36442 : if (likely(PyInt_Check(x) || PyLong_Check(x)))
36443 : #else
36444 0 : if (likely(PyLong_Check(x)))
36445 : #endif
36446 0 : return __Pyx_NewRef(x);
36447 : #if CYTHON_USE_TYPE_SLOTS
36448 0 : m = Py_TYPE(x)->tp_as_number;
36449 : #if PY_MAJOR_VERSION < 3
36450 : if (m && m->nb_int) {
36451 : name = "int";
36452 : res = m->nb_int(x);
36453 : }
36454 : else if (m && m->nb_long) {
36455 : name = "long";
36456 : res = m->nb_long(x);
36457 : }
36458 : #else
36459 0 : if (likely(m && m->nb_int)) {
36460 0 : name = "int";
36461 0 : res = m->nb_int(x);
36462 : }
36463 : #endif
36464 : #else
36465 : if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
36466 : res = PyNumber_Int(x);
36467 : }
36468 : #endif
36469 0 : if (likely(res)) {
36470 : #if PY_MAJOR_VERSION < 3
36471 : if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
36472 : #else
36473 0 : if (unlikely(!PyLong_CheckExact(res))) {
36474 : #endif
36475 0 : return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
36476 : }
36477 : }
36478 0 : else if (!PyErr_Occurred()) {
36479 0 : PyErr_SetString(PyExc_TypeError,
36480 : "an integer is required");
36481 : }
36482 : return res;
36483 : }
36484 338 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
36485 338 : Py_ssize_t ival;
36486 338 : PyObject *x;
36487 : #if PY_MAJOR_VERSION < 3
36488 : if (likely(PyInt_CheckExact(b))) {
36489 : if (sizeof(Py_ssize_t) >= sizeof(long))
36490 : return PyInt_AS_LONG(b);
36491 : else
36492 : return PyInt_AsSsize_t(b);
36493 : }
36494 : #endif
36495 338 : if (likely(PyLong_CheckExact(b))) {
36496 : #if CYTHON_USE_PYLONG_INTERNALS
36497 338 : if (likely(__Pyx_PyLong_IsCompact(b))) {
36498 338 : return __Pyx_PyLong_CompactValue(b);
36499 : } else {
36500 0 : const digit* digits = __Pyx_PyLong_Digits(b);
36501 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
36502 0 : switch (size) {
36503 : case 2:
36504 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
36505 0 : return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36506 : }
36507 : break;
36508 : case -2:
36509 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
36510 0 : return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36511 : }
36512 : break;
36513 : case 3:
36514 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
36515 : return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36516 : }
36517 : break;
36518 : case -3:
36519 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
36520 : return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36521 : }
36522 : break;
36523 : case 4:
36524 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
36525 : return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36526 : }
36527 : break;
36528 : case -4:
36529 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
36530 : return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36531 : }
36532 : break;
36533 : }
36534 : }
36535 : #endif
36536 0 : return PyLong_AsSsize_t(b);
36537 : }
36538 0 : x = PyNumber_Index(b);
36539 0 : if (!x) return -1;
36540 0 : ival = PyInt_AsSsize_t(x);
36541 0 : Py_DECREF(x);
36542 : return ival;
36543 : }
36544 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
36545 : if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
36546 : return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
36547 : #if PY_MAJOR_VERSION < 3
36548 : } else if (likely(PyInt_CheckExact(o))) {
36549 : return PyInt_AS_LONG(o);
36550 : #endif
36551 : } else {
36552 : Py_ssize_t ival;
36553 : PyObject *x;
36554 : x = PyNumber_Index(o);
36555 : if (!x) return -1;
36556 : ival = PyInt_AsLong(x);
36557 : Py_DECREF(x);
36558 : return ival;
36559 : }
36560 : }
36561 2302 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
36562 2302 : return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
36563 : }
36564 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
36565 : return PyInt_FromSize_t(ival);
36566 : }
36567 :
36568 :
36569 : /* #### Code section: utility_code_pragmas_end ### */
36570 : #ifdef _MSC_VER
36571 : #pragma warning( pop )
36572 : #endif
36573 :
36574 :
36575 :
36576 : /* #### Code section: end ### */
36577 : #endif /* Py_PYTHON_H */
|